<i18n dev> RFR: 8288979: Improve CLDRConverter run time [v3]

Daniel Jeliński djelinski at openjdk.org
Thu Jun 23 08:59:41 UTC 2022

On Wed, 22 Jun 2022 21:45:25 GMT, Naoto Sato <naoto at openjdk.org> wrote:

>> IIUC, once this fix makes it to the repository, the build will be reproducible. Making it to be sorted is a welcome enhancement (I compare the generated bundles manually from time to time), but it may be costly so it could defy the performance improvement?
> BTW, this can utilize the new `HashMap.newHashMap()`, although I don't think resizing would be occurring in this case.

> once this fix makes it to the repository, the build will be reproducible

Yes, we always produce the same source code. Given the same order of modifications, a hashmap will produce the same iteration order.

> LinkedHashMap could be used to retain the iteration order.

Just added. The input maps were always sorted in some order (they were either LinkedHashMaps or TreeMaps), and now we preserve that order.
This means a lot of changes in the generated output files now, but hopefully in the future the changes will be much easier to review.

TIL: `put` / `putIfAbsent` on an existing entry does not change the iteration order of a `LinkedHashMap` unless `accessOrder` is true.


PR: https://git.openjdk.org/jdk/pull/9243

More information about the i18n-dev mailing list