We can use longObjectMap to replace Map
We need to do the following:
我们可以使用longObjectMap来替换dubbo中的Map
我们需要做下面的事情:
this work make sense, but do we have a official way to measure performance improvement? we don't have benchmark running in CI or other stable platform.
good question. At the moment we really lack the internal benchmark. I think you can add a benchmark to the module. The performance of the new submission benchmark cannot be significantly lower than the previous benchmark results. What do u think?
for this issue
I want to do this job of using longObjectMap replacing LongObjectMap.
I am willing to take this task and I will start doing it.
Can you help me with the details of the process
On Wed, Dec 12, 2018, 4:15 AM water-coder <[email protected] wrote:
for this issue
I want to do this job of using longObjectMap replacing LongObjectMap.
I am willing to take this task and I will start doing it.—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/apache/incubator-dubbo/issues/2882#issuecomment-446533994,
or mute the thread
https://github.com/notifications/unsubscribe-auth/Ari7Px1gTgSlUqUHmKbJtqkXgHy7YTSUks5u4NcmgaJpZM4ZAIEY
.
@bpaull1981
Hi, seems like @water-coder has claimed this job.
@water-coder I'd like to help u to finish this.
@carryxyh
OK,thx. I will try my best to do this.
@carryxyh do you mean that the LongObjectHashMap is io.netty.util.collection.LongObjectHashMap<V>? I just take a look at the usage of dubbo existing code, the Mapjava.util.concurrent.ConcurrentHashMap,but the LongObjectHashMap is not Thread Safe . How do think about it ?
@lexburner
I think we should have a benchmark about the sync long object map and concurrent map.
Personally think the concurrent map is better, but we should have a benchmark about this two cases.
The person who claimed this task will go to the benchmark, we have already passed the mail.
Another thing, maybe my description is problematic, we are going to replace longobjectmap and other maps such as intobjectmap. Not just longobjectmap.
And the longobjectmap and intobjectmap has many impls (not just in netty). Could u give some ideas about this?
LongObjectHashMap and IntObjectHashMap 无论是 netty 的实现还是像 JCtool, hppc 这样实现,据我所知,并不是为了快而诞生的,他们突出的一个特性是相比 HashMap 节约了内存的使用量,并且可能在解决 Hash 冲突方面做了一些优化,
A hash map implementation of LongObjectMap https://netty.io/4.1/api/io/netty/util/collection/LongObjectMap.html that uses open addressing for keys. To minimize the memory footprint, this class uses open addressing rather than chaining. Collisions are resolved using linear probing. Deletions implement compaction, so cost of remove can approach O(N) for full maps, which makes a small loadFactor recommended.
线性探测和链表的方式解决 Hash 冲突其实本质上是一种 trade off,在不同场景下可以说各有优势,但在实际使用场景下,比如 Dubbo,这两者的差距我觉得很难考量,或者请允许我猜测,他们的差距是微乎其微的。我个人建议是负责测试同学不能仅仅评测单机下的 micro-benchmark ,而是要在实际场景中测试两者的差距,包括 qps 和内存使用量,这工作我觉得是很大的。毕竟我们引入了第三方的依赖,需要有足够的数据佐证这样的改动是有意义的,否则,我在 benchmark 之前,会认为这样的 trade off 是我倾向于保持原样,使用原有的 HashMap。
我的观点是主要围绕上述两点去展开工作。
另外,如果想要替换 ConcurrentHashMap,可以测评下 JCtools 的并发 Map,据称是比 jdk 更强。
English:pls copy the above Chinese issue to google translation ,forgive my laziness, hhh.
在 2018年12月19日,上午10:48,时无两丶 notifications@github.com 写道:
@lexburner https://github.com/lexburner
I think we should have a benchmark about the sync long object map and concurrent map.
Personally think the concurrent map is better, but we should have a benchmark about this two cases.
The person who claimed this task will go to the benchmark, we have already passed the mail.Another thing, maybe my description is problematic, we are going to replace longobjectmap and other maps such as intobjectmap. Not just longobjectmap.
And the longobjectmap and intobjectmap has many impls (not just in netty). Could u give some ideas about this?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/apache/incubator-dubbo/issues/2882#issuecomment-448450044, or mute the thread https://github.com/notifications/unsubscribe-auth/AK9DJuvwRqLIKU8uNM_GgnGxeO9WrRH3ks5u6ajsgaJpZM4ZAIEY.
@lexburner I think your comments are very direct. At present, the stand-alone test, longObjectMap and hashMap in the number of puts reached a million level, the performance gap is very large, you said the thread safety problem, concurrent performance and memory testing, it is indeed should consider and come up with accurate evidence to support. There are also tests of actual scenes that are more convincing.