Opened 5 years ago
Last modified 5 years ago
#20813 closed enhancement
Modernize org.openstreetmap.josm.gui.layer.geoimage.ImageDisplay — at Version 3
| Reported by: | simon04 | Owned by: | simon04 |
|---|---|---|---|
| Priority: | normal | Milestone: | 21.05 |
| Component: | Core image mapping | Version: | |
| Keywords: | heap profiling intellij yourkit | Cc: | Don-vip, taylor.smock, Bjoeni, GerdP, StephaneP |
Description (last modified by )
- ImageDisplay is using java.awt.MediaTracker.
According to https://stackoverflow.com/a/7369580/205629 (written in 2010):
MediaTracker was useful in 1995. Back then the primary GUI use of java was Applets, and Applets would usually load images slowly over the network.
...
These days you can typically load images synchronously, and it is best to use ImageIO.
- ImageDisplay creates a new thread for each image to be loaded. We can use
MainApplication.worker
attachment:20813-alpha.patch contains 1. + 2.
- Omit rescaling via
ImageProvider.toBufferedImageandImageProvider.createScaledImage? When zapping through images, approx. 50% of heap allocations are due toImageIO.read()and approx. 50% are due toImageProvider.toBufferedImage/ImageProvider.createScaledImage.
Change History (4)
by , 5 years ago
| Attachment: | 20813-alpha.patch added |
|---|
comment:1 by , 5 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 5 years ago
| Cc: | added |
|---|
comment:3 by , 5 years ago
| Description: | modified (diff) |
|---|
Note:
See TracTickets
for help on using tickets.


