Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

写入es数据时,Properties类 导致锁竞争降低并发性能 #40

Open
linguanghuan opened this issue Aug 27, 2020 · 0 comments
Open

Comments

@linguanghuan
Copy link

并发写入es数据时,发现这个插件会有性能瓶颈。瓶颈代码位置 STConverter.java:104 java.util.Hashtable.containsKey
这里很容易导致锁竞争,写并发上去后,就容易卡在这里。
事实上,字典在初始化时用Properties(继承自Hashtable)加载完成后,并没有在其他地方并触发任何改动,那么这里的锁就是没有必要的。
不要用Hashtable(或者Properties),可以直接改用Hashmap。

@linguanghuan linguanghuan changed the title Properties加载的字典数据 并发写入会导致较严重的锁问题 写入es数据时,Properties类 导致锁竞争降低并发性能 Aug 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant