Modify

Opened 3 years ago

Closed 23 months ago

Last modified 23 months ago

#20703 closed defect (fixed)

GeographicReader.createOrGetWay is slow due to many Arrays.copyOf

Reported by: simon04 Owned by: Don-vip
Priority: normal Milestone:
Component: Plugin opendata Version:
Keywords: template_report performance profiling intellij yourkit Cc:

Description (last modified by simon04)

What steps will reproduce the problem?

  1. Run profiler while opening https://osmdata.openstreetmap.de/download/simplified-land-polygons-complete-3857.zip

What is the expected result?

What happens instead?

A considerable amount of time is spent in GeographicReader.createOrGetWay is slow due to many Arrays.copyOf


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

java.util.Arrays.copyOf(Object[], int)
org.openstreetmap.josm.tools.Utils.addInArrayCopy(Object[], Object)
org.openstreetmap.josm.data.osm.Way.addNode(Node)
org.openstreetmap.josm.plugins.opendata.core.io.geographic.GeographicReader.createOrGetWay(LineString)
org.openstreetmap.josm.plugins.opendata.core.io.geographic.ShpReader.processGeometryCollection(GeometryCollection)
org.openstreetmap.josm.plugins.opendata.core.io.geographic.ShpReader.parseFeature(Feature, Component)
org.openstreetmap.josm.plugins.opendata.core.io.geographic.ShpReader.parse(File, ProgressMonitor)
org.openstreetmap.josm.plugins.opendata.core.io.geographic.ShpReader.parseDataSet(InputStream, File, AbstractDataSetHandler, ProgressMonitor)
org.openstreetmap.josm.plugins.opendata.core.io.geographic.ShpImporter.parseDataSet(InputStream, ProgressMonitor)
org.openstreetmap.josm.gui.io.importexport.OsmImporter.loadLayer(InputStream, File, String, ProgressMonitor)
org.openstreetmap.josm.gui.io.importexport.OsmImporter.importData(InputStream, File, ProgressMonitor)
org.openstreetmap.josm.plugins.opendata.core.io.AbstractImporter.importData(File, ProgressMonitor)
org.openstreetmap.josm.gui.io.importexport.FileImporter.importDataHandleExceptions(File, ProgressMonitor)
org.openstreetmap.josm.actions.OpenFileAction$OpenFileTask.importData(FileImporter, List)
org.openstreetmap.josm.actions.OpenFileAction$OpenFileTask.realRun()
org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun()
org.openstreetmap.josm.gui.PleaseWaitRunnable.run()
java.util.concurrent.Executors$RunnableAdapter.call()
java.util.concurrent.FutureTask.run()
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor$Worker)
java.util.concurrent.ThreadPoolExecutor$Worker.run()
java.lang.Thread.run()
Revision:17702
Is-Local-Build:true
Build-Date:2021-04-02 15:33:31

Identification: JOSM/1.5 (17702 SVN de) Mac OS X 10.16
OS Build number: macOS 11.2.3 (20D91)
Memory Usage: 130 MB / 2048 MB (112 MB allocated, but free)
Java version: 16+36, AdoptOpenJDK, OpenJDK 64-Bit Server VM
Look and Feel: com.apple.laf.AquaLookAndFeel
Screen: Display 1 1440×900 (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
Environment variable LANG: en_IE.UTF-8
System property file.encoding: UTF-8
System property sun.jnu.encoding: UTF-8

Attachments (1)

flamegraph.png (284.4 KB ) - added by simon04 3 years ago.

Download all attachments as: .zip

Change History (5)

by simon04, 3 years ago

Attachment: flamegraph.png added

comment:1 by simon04, 3 years ago

Description: modified (diff)

comment:2 by simon04, 3 years ago

Description: modified (diff)

comment:3 by taylor.smock, 23 months ago

Resolution: fixed
Status: newclosed

In 35984/osm:

Fix #20703: GeographicReader.createOrGetWay is slow due to many Arrays.copyOf (opendata)

This lead to a speedup for loading the simplified-land-polygons-complete-3857.zip
file from ~5.5 minutes to <2 minutes. Allocations in createOrGetWay went from
187 GiB to 3.5 GiB.

comment:4 by taylor.smock, 23 months ago

In 35985/osm:

See #20703 (dist): GeographicReader.createOrGetWay is slow due to many Arrays.copyOf (opendata)

This lead to a speedup for loading the simplified-land-polygons-complete-3857.zip
file from ~5.5 minutes to <2 minutes. Allocations in createOrGetWay went from
187 GiB to 3.5 GiB.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Don-vip.
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.