#18871 closed defect (fixed)
Performance issues after updating
Reported by: | Owned by: | team | |
---|---|---|---|
Priority: | major | Milestone: | 20.03 |
Component: | Core | Version: | |
Keywords: | template_report regression performance | Cc: | simon04 |
Description
Description
After upgrading JOSM from version 15806 to 15937 there is noticeable performance loss when moving nodes, ways or sometimes when adding tags. I noticed higher cpu usage. Downgrading to previous version (15806) fixes problem.
I have tested it on two different computers (with the same operating system).
Please provide any additional information below. Attach a screenshot if possible.
Relative:URL: ^/trunk Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Last:Changed Date: 2020-02-26 10:50:27 +0100 (Wed, 26 Feb 2020) Revision:15937 Build-Date:2020-02-26 09:52:41 URL:https://josm.openstreetmap.de/svn/trunk Identification: JOSM/1.5 (15937 pl) Linux Arch Linux Memory Usage: 207 MB / 4008 MB (92 MB allocated, but free) Java version: 13.0.2+8, N/A, OpenJDK 64-Bit Server VM Screen: :0.0 2560x1440 Maximum Screen Size: 2560x1440
Attachments (3)
Change History (27)
by , 5 years ago
Attachment: | josm-comp.mp4 added |
---|
comment:1 by , 5 years ago
Keywords: | regression performance added |
---|---|
Priority: | normal → major |
comment:2 by , 5 years ago
follow-up: 4 comment:3 by , 5 years ago
Milestone: | → 20.03 |
---|
comment:4 by , 5 years ago
I have tested and problem was introduced in snapshot 15889.
Snapshop 15887 does not have this issue.
comment:6 by , 5 years ago
I've performed a performance test: for every primitive in source:trunk/nodist/data/neubrandenburg.osm.bz2, an image is obtained. Here are the results for r15806, r15888, r16053:
-
test/performance/org/openstreetmap/josm/gui/mappaint/MapRendererPerformanceTest.java
> git diff diff --git a/test/performance/org/openstreetmap/josm/gui/mappaint/MapRendererPerformanceTest.java b/test/performance/org/openstreetmap/josm/gui/mappaint/MapRendererPerformanceTest.java index c20fe1ca1..6b2479f40 100644
a b public static void cleanUp() { 170 174 MapPaintStyleLoader.reloadStyles(defaultStyleIdx); 171 175 } 172 176 177 @Test 178 public void testImageProviderGetPadded() { 179 final LongSummaryStatistics statistics = new LongSummaryStatistics(); 180 for (int i = 0; i < 3; i++) { 181 final Stopwatch stopwatch = Stopwatch.createStarted(); 182 for (OsmPrimitive primitive : dsCity.allPrimitives()) { 183 ImageProvider.getPadded(primitive, ImageProvider.ImageSizes.SMALLICON.getImageDimension()); 184 // if (primitive.isTagged()) MapPaintStyles.getNodeIcon(primitive.getKeys().getTags().iterator().next()); 185 } 186 statistics.accept(stopwatch.elapsed()); 187 } 188 System.out.println(statistics); 189 // r15806 MapPaintStyles.getNodeIcon LongSummaryStatistics{count=3, sum=23827, min=4564, average=7942.333333, max=11388} 190 // r15806 ImageProvider.getPadded LongSummaryStatistics{count=3, sum=55536, min=18056, average=18512.000000, max=19324} 191 // r15888 MapPaintStyles.getNodeIcon LongSummaryStatistics{count=3, sum=24332, min=5063, average=8110.666667, max=11515} 192 // r15888 ImageProvider.getPadded LongSummaryStatistics{count=3, sum=57233, min=18730, average=19077.666667, max=19731} 193 // r16053 MapPaintStyles.getNodeIcon LongSummaryStatistics{count=3, sum=29961, min=6784, average=9987.000000, max=13779} 194 // r16053 ImageProvider.getPadded LongSummaryStatistics{count=3, sum=5354, min=1541, average=1784.666667, max=2245} 195 // r16053 ImageProvider.getPadded LongSummaryStatistics{count=20, sum=31170, min=1494, average=1558.500000, max=2200} 196 } 197 173 198 private static class PerformanceTester { 174 199 public double scale = 0; 175 200 public LatLon center = LL_CITY;
@team, any ideas/hints what might have caused this performance regression?
comment:8 by , 5 years ago
comment:9 by , 5 years ago
I've checked it on another computer (MacOS) and there's also this slowdown noticable. It happens even when I grab point that is not connected to anything.
Relative:URL: ^/trunk Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Last:Changed Date: 2020-02-21 21:19:34 +0100 (Fri, 21 Feb 2020) Revision:15889 Build-Date:2020-02-22 02:30:59 URL:https://josm.openstreetmap.de/svn/trunk Identification: JOSM/1.5 (15889 pl) Mac OS X 10.15.2 OS Build number: Mac OS X 10.15.2 (19C57) Memory Usage: 385 MB / 2048 MB (109 MB allocated, but free) Java version: 13.0.2+8, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM Screen: Display 69732928 1680x1050, Display 1127222057 1920x1080, Display 1127222050 1920x1080 Maximum Screen Size: 1920x1080 Dataset consistency test: No problems found
comment:10 by , 5 years ago
Err, since r15889, org.openstreetmap.josm.tools.ImageProvider#paddedImageCache
uses Image
as key, likely causing expensive hashCode
computations. I'm trying to move this cache into the individual ImageResource
instances.
comment:15 by , 5 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Most likely since the issue described in comment:10 has been addressed.
comment:16 by , 5 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
I just tried to move a single node, with a small data set, and it is extremely slow.
comment:17 by , 5 years ago
by , 5 years ago
by , 5 years ago
Attachment: | selection.jpg added |
---|
comment:19 by , 5 years ago
Would match my results. I have preference properties.presets.visible=false
comment:20 by , 5 years ago
No, sorry, forget that. The setting is not about the icon for the selected element.
comment:23 by , 5 years ago
You're welcome :) One further improvement would be to not refresh the padded icon in selection list for movement events. I'm not sure if it's doable easily.
Can you please test various snapshots between r15806 and r15937 to help us to narrow the range of revisions where the problem was introduced? You can download them here: https://josm.openstreetmap.de/download/