#22529 closed enhancement (fixed)
[Patch] possibly improve performance in class `ChangesetDataSet`
| Reported by: | GerdP | Owned by: | team |
|---|---|---|---|
| Priority: | normal | Milestone: | 22.12 |
| Component: | Core | Version: | |
| Keywords: | performance | Cc: |
Description
When reading changesets, JOSM repeatedly may call method getPrimitiveId() for the same object in ChangesetDataSet.put() which is called when a changeset is read. Unless the run time optimizer can kick in this method creates a new SimplePrimitiveId instance each time it is called. The patch creates a single instance and uses map.computeIfAbsent() as recommended by sonarlint.
Attachments (1)
Change History (10)
by , 3 years ago
| Attachment: | cs-perf.patch added |
|---|
comment:1 by , 3 years ago
| Milestone: | → 22.12 |
|---|
comment:4 by , 3 years ago
No. I had been intending to do a release this week, then I started getting bug reports for something I changed three weeks ago.
comment:6 by , 3 years ago
| Milestone: | 22.12 → 22.11 |
|---|
comment:7 by , 3 years ago
@Taylor:
Thanks for your work. Please, do not be too disappointed as time is relative. At least we got around a hotfix so far. One question would be how to get more people to use latest.
comment:8 by , 3 years ago
We could try changing the bug report window to say something along the lines of Please consider running josm-latest(link) so we can avoid bugs in josm-tested.
Or maybe, in the wiki:StartupPage, we can have a running list of upcoming changes for feedback.
So
Upcoming changes (in JOSM latest, next release {planned [date]|postponed due to bug reports to [date]})
- Add tabs to the ImageViewer (see #21605, feedback would be appreciated)
- OAuth 2 support (expert mode only until July 2023)



Thanks for profiling this. :)
It looks like
SimplePrimitiveIdcould be a value/record class. Unfortunately, we aren't on Java 14+ yet. And I'd have to check for binary compatibility problems with plugins.Anyway, it looks good to me.