RFR: 8288979: Improve CLDRConverter run time
Daniel Jeliński
djelinski at openjdk.org
Wed Jun 22 14:41:07 UTC 2022
This PR improves the performance of deduplication done by ResourceBundleGenerator.
The original implementation compared every pair of values, requiring O(n^2) time. The new implementation uses a HashMap to find duplicates, trading off some extra memory consumption for O(n) computational complexity. In practice the time to generate jdk.localedata on my Linux VM files dropped from 14 to 8 seconds.
The resulting files (under build/support/gensrc/java.base and jdk.localedata) have different contents; map iteration order depends on the insertion order, and the insertion order of the new implementation is different from the original.
The files generated before and after this change have the same size.
-------------
Commit messages:
- Speed up CLDR deduplication
Changes: https://git.openjdk.org/jdk/pull/9243/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=9243&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8288979
Stats: 101 lines in 1 file changed: 56 ins; 27 del; 18 mod
Patch: https://git.openjdk.org/jdk/pull/9243.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/9243/head:pull/9243
PR: https://git.openjdk.org/jdk/pull/9243
More information about the core-libs-dev
mailing list