Modify

Opened 3 years ago

Closed 3 years ago

Last modified 23 months ago

#20613 closed enhancement (fixed)

Reduce heap allocations (while rendering)

Reported by: simon04 Owned by: simon04
Priority: normal Milestone: 21.03
Component: Core Version:
Keywords: template_report profiling heap alloc Cc:

Description


Attachments (1)

profile.html (1.5 MB ) - added by simon04 3 years ago.

Download all attachments as: .zip

Change History (17)

by simon04, 3 years ago

Attachment: profile.html added

comment:1 by simon04, 3 years ago

In 17581/josm:

see #20613 - Avoid heap allocations in MapViewState.getOutsideRectangleFlags

4.74% in AbstractMapRendererPerformanceTestParent#testCity amount to Rectangle2D.Double from MapViewState

comment:2 by simon04, 3 years ago

In 17582/josm:

see #20613 - Avoid heap allocations in DividedScale.getWithRange

4.74% in AbstractMapRendererPerformanceTestParent#testCity amount to Range from DividedScale.getWithRange

comment:3 by simon04, 3 years ago

In 17583/josm:

see #20613 - Avoid heap allocations in AbstractSelector.matches

6.15%->1.92% in AbstractMapRendererPerformanceTestParent#testCity

comment:4 by simon04, 3 years ago

In 17584/josm:

see #20613 - Introduce Tagged.keys()

Avoids creating a temporary HashMap just for iteration purposes

comment:5 by simon04, 3 years ago

In 17585/josm:

see #20613 - Use Tagged.visitKeys()

Avoids creating a temporary HashMap just for iteration purposes

comment:6 by simon04, 3 years ago

In 17586/josm:

see #20613 - Use Tagged.keys() and Tagged.visitKeys()

comment:7 by simon04, 3 years ago

In 17587/josm:

see #20613 - AbstractPrimitive.keySet/keys: fix fast path for single key

comment:8 by Don-vip, 3 years ago

r17586 / r17587 cause a test failure:

org.openstreetmap.josm.gui.layer.gpx.ConvertToDataLayerActionTest.testFromTrack()
java.lang.NullPointerException: Cannot read the array length because "this.keys" is null
	at org.openstreetmap.josm.data.osm.AbstractPrimitive.visitKeys(AbstractPrimitive.java:451)
	at org.openstreetmap.josm.gui.layer.gpx.ConvertFromGpxLayerAction.filterDataSet(ConvertFromGpxLayerAction.java:176)
	at org.openstreetmap.josm.gui.layer.gpx.ConvertFromGpxLayerAction.convert(ConvertFromGpxLayerAction.java:115)
	at org.openstreetmap.josm.gui.layer.gpx.ConvertToDataLayerActionTest.testFromTrack(ConvertToDataLayerActionTest.java:127)
	at org.openstreetmap.josm.gui.layer.gpx.ConvertToDataLayerActionTest.testFromTrack(ConvertToDataLayerActionTest.java:81)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:688)
	at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
...

See https://josm.openstreetmap.de/jenkins/job/JOSM/jdk=JDK8/lastCompletedBuild/testReport/org.openstreetmap.josm.gui.layer.gpx/ConvertToDataLayerActionTest/testFromTrack__/

comment:9 by simon04, 3 years ago

In 17589/josm:

see #20613 - Fix NPE in AbstractPrimitive.visitKeys

comment:10 by simon04, 3 years ago

Additional patches as GitHub PR (for a CI via GitHub Actions):

comment:11 by simon04, 3 years ago

In 17593/josm:

see #20613 - Split KeyCondition/KeyRegexpCondition

Rewrite patterns for prefix/substring/suffix checks.

5.75->2.93% of allocations in MapCSSTagCheckerPerformanceTest.testCity relate to Pattern matching.

comment:12 by simon04, 3 years ago

In 17601/josm:

see #20613 - Fix MapCSSParserTest

comment:13 by simon04, 3 years ago

In 17604/josm:

see #20613 - Fix MapCSSParserTest

comment:14 by simon04, 3 years ago

Resolution: fixed
Status: assignedclosed

Enough for this milestone. comment:10 needs #20621.

comment:15 by Klumbumbus, 3 years ago

In 17944/josm:

fix #21063, see #20613 - Fix is_in:* validator rules

comment:16 by Klumbumbus, 23 months ago

A regression fixed in #22073.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain simon04.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.