-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #24075: Reduce memory allocations for TaggingPresetItem#matches
This is done by doing the following: * Converting `KeyedItem.match` to a `MatchType` from a `String` * This avoids calling `MatchType#ofString` repeatedly * This does decrease the visibility of the `match` field ''and'' change the type * Avoiding `ArrayList.Itr` creation in `TaggingPresetItem#matches` * This does produce some duplicate code, unfortunately. The `KeyedItem.match` change reduces memory allocations in `KeyedItem#matches` by 98% and CPU cycles by 77%. The `TaggingPresetItem#matches` change to avoid `ArrayList.Itr` creation reduces memory allocations by 100% and CPU cycles by 94% for `ArrayList` (only looking at changes between the for loop types). The net change for `TaggingPresetItem#matches` is a reduction of memory allocations by 99% and CPU cycles by 74%. As noted in the ticket, there was a reduction in GC by ~80%. git-svn-id: https://josm.openstreetmap.de/svn/trunk@19285 0c6e7542-c601-0410-84e7-c038aed88b3b
- Loading branch information
taylor.smock
committed
Jan 16, 2025
1 parent
c16507a
commit 4e5942c
Showing
3 changed files
with
58 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters