dragonwell-project / dragonwell21

GNU General Public License v2.0
70 stars 20 forks source link

[Backport] 8322149: ConcurrentHashMap smarter presizing for copy constructor and putAll #102

Closed MaxXSoft closed 2 months ago

MaxXSoft commented 2 months ago

[Backport] 8322149: ConcurrentHashMap smarter presizing for copy constructor and putAll

Summary: ConcurrentHashMap::ConcurrentHashMap() -> putAll() -> tryPresize() -> transfer() does a lot of unnecessary work. There is nothing to transfer from the old table, since the table is just being initialized.

Testing: CI testing

Reviewers: lingjun-cg, yuleil

Issue: https://github.com/dragonwell-project/dragonwell21/issues/101

CLAassistant commented 2 months ago

CLA assistant check
All committers have signed the CLA.

MaxXSoft commented 2 months ago

Thanks for the review!