#11655 closed enhancement (fixed)
[patch] memory optimization
Reported by: | shinigami | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 15.08 |
Component: | Core | Version: | latest |
Keywords: | Cc: |
Description ¶
1) maps in getKeys/keySet are presized to avoid resizing/realocation of internals
2) DateUtils.fromString - most of method is refactored to new one returning long, used when OsmReader.readCommon. Look at it please;).
Change History (7)
by , 10 years ago
Attachment: | memory.patch added |
---|
comment:1 by , 10 years ago
Summary: | memory optimization → [patch] memory optimization |
---|
Please add "[patch]" in the title, otherwise your patches might get overlooked!
1) Interesting... Could you explain the (4 * keys.length) / 6 + 1
-formula?
2) looks fine to me.
follow-up: 4 comment:2 by , 10 years ago
4/3 is from default load factor of hashmap, 1/2 because it takes only half of array, +1 to be sure.
comment:4 by , 10 years ago
Replying to anonymous:
4/3 is from default load factor of hashmap, 1/2 because it takes only half of array, +1 to be sure.
Good to know, the official Java doc for HashMap is not making it particularly clear what the capacity refers to.
I've educated myself and changed the formula to get the supposedly optimal value.
comment:5 by , 10 years ago
Milestone: | → 15.07 |
---|
patch