Modify

Opened 16 months ago

Closed 16 months ago

Last modified 7 weeks 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 16 months ago.

Download all attachments as: .zip

Change History (17)

Changed 16 months ago by simon04

Attachment: profile.html added

comment:1 Changed 16 months ago by simon04

In 17581/josm:

see #20613 - Avoid heap allocations in MapViewState.getOutsideRectangleFlags

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

comment:2 Changed 16 months ago by simon04

In 17582/josm:

see #20613 - Avoid heap allocations in DividedScale.getWithRange

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

comment:3 Changed 16 months ago by simon04

In 17583/josm:

see #20613 - Avoid heap allocations in AbstractSelector.matches

6.15%->1.92% in AbstractMapRendererPerformanceTestParent#testCity

comment:4 Changed 16 months ago by simon04

In 17584/josm:

see #20613 - Introduce Tagged.keys()

Avoids creating a temporary HashMap just for iteration purposes

comment:5 Changed 16 months ago by simon04

In 17585/josm:

see #20613 - Use Tagged.visitKeys()

Avoids creating a temporary HashMap just for iteration purposes

comment:6 Changed 16 months ago by simon04

In 17586/josm:

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

comment:7 Changed 16 months ago by simon04

In 17587/josm:

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

comment:8 Changed 16 months ago by Don-vip

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 Changed 16 months ago by simon04

In 17589/josm:

see #20613 - Fix NPE in AbstractPrimitive.visitKeys

comment:10 Changed 16 months ago by simon04

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

comment:11 Changed 16 months ago by simon04

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 Changed 16 months ago by simon04

In 17601/josm:

see #20613 - Fix MapCSSParserTest

comment:13 Changed 16 months ago by simon04

In 17604/josm:

see #20613 - Fix MapCSSParserTest

comment:14 Changed 16 months ago by simon04

Resolution: fixed
Status: assignedclosed

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

comment:15 Changed 12 months ago by Klumbumbus

In 17944/josm:

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

comment:16 Changed 7 weeks ago by Klumbumbus

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.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.