Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#20563 closed defect (fixed)

[Patch] PluginListParser.parse amounts to 80% of allocations during startup

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

Description

What steps will reproduce the problem?

java -agentpath:async-profiler-2.0-rc-macos-x64/build/libasyncProfiler.so=start,file=profile.html,event=alloc -jar josm-latest.jar

https://github.com/jvm-profiling-tools/async-profiler

What is the expected result?

PluginListParser.parse does not contribute significantly to heap allocations

What happens instead?

PluginListParser.parse amounts to 80% of allocations during startup

Please provide any additional information below. Attach a screenshot if possible.

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2021-03-01 23:51:35 +0100 (Mon, 01 Mar 2021)
Revision:17551
Build-Date:2021-03-02 02:30:57
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (17551 en) Mac OS X 10.16
OS Build number: macOS 11.2.1 (20D74)
Memory Usage: 280 MB / 2048 MB (108 MB allocated, but free)
Java version: 15.0.2+7, Azul Systems, Inc., OpenJDK 64-Bit Server VM
Look and Feel: com.formdev.flatlaf.FlatLightLaf
Screen: Display 1 1680×1050 (scaling 2,00×2,00) Display 2 3008×1692 (scaling 2,00×2,00)
Maximum Screen Size: 3008×1692
Best cursor sizes: 16×16→16×16, 32×32→32×32

Plugins:
+ flatlaf (35703)
+ utilsplugin2 (35691)

Map paint styles:
+ https://josm.openstreetmap.de/josmfile?page=Styles/PublicTransport&zip=1

Attachments (3)

profile.html.gz (197.1 KB ) - added by simon04 4 years ago.
profile.html (1.4 MB ) - added by simon04 4 years ago.
20563.patch (9.0 KB ) - added by simon04 4 years ago.

Download all attachments as: .zip

Change History (12)

by simon04, 4 years ago

Attachment: profile.html.gz added

comment:1 by Don-vip, 4 years ago

is the html file ok? I can't open it

comment:2 by simon04, 4 years ago

The file is okay on my disk, but attachment:profile.html.gz​ is broken. I'll upload the non-gz variant.

by simon04, 4 years ago

Attachment: profile.html added

by simon04, 4 years ago

Attachment: 20563.patch added

comment:3 by simon04, 4 years ago

Milestone: 21.03
Owner: changed from team to simon04
Summary: PluginListParser.parse amounts to 80% of allocations during startup[Patch] PluginListParser.parse amounts to 80% of allocations during startup

comment:4 by Don-vip, 4 years ago

So much better. I wonder why we didn't think of storing the attributes directly.

comment:5 by simon04, 4 years ago

Resolution: fixed
Status: newclosed

In 17571/josm:

fix #20563 - PluginListParser.parse amounts to 80% of allocations during startup

comment:6 by Don-vip, 4 years ago

It seems these tests, or plugins, need an update:

org.openstreetmap.josm.plugins.PluginHandlerTest.testPluginInformationAction()
org.openstreetmap.josm.actions.downloadtasks.PluginDownloadTaskTest.testUpdatePluginCorrupt

See jenkins/job/JOSM/jdk=JDK8/lastCompletedBuild/testReport/

comment:7 by simon04, 4 years ago

In 17573/josm:

see #20563 - Fix PluginHandler, PluginInformation

Regression of r17571.

comment:8 by simon04, 4 years ago

Err, concerning the first test, the class Attributes, starting with Java 11,

This map and its views have a predictable iteration order, namely the order that keys were inserted into the map, as with LinkedHashMap.
https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/jar/Attributes.html

PluginDownloadTaskTest found an actual glitch in my commit...

in reply to:  8 comment:9 by Don-vip, 4 years ago

Replying to simon04:

PluginDownloadTaskTest found an actual glitch in my commit...

That's why we have them :)

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.