Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make PNJ the default map image io backend #306

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

jpenilla
Copy link
Owner

@jpenilla jpenilla commented Oct 8, 2024

Configs with (effectively) default image io settings will be switched to use PNJ. Otherwise, they will continue to use BufferedImage. Acceptable values for the backend option are pnj and bufferedimage.

Some basic testing shows that PNJ gives compression near the max setting for BufferedImage while taking less time.

The following results are for rendering the same map twice in a row (after a warmup run) averaged over a couple of runs (time), and for the whole tiles directory for the dimension (size). Time is what was spent in MapImage#save on the image io thread as measured by spark (async profiler).

Description Size Time
PNJ 724K 1400ms
BufferedImage compress-images=enabled, value=1 712K 2300ms
BufferedImage compress-images=disabled 804K 950ms

Questions to answer before merging:

  • Do we want to change the default or just add an option?
    • Typically when users are bottlenecked by image io it's due to disk speed, not encoding/decoding.
    • We may want to run more benchmarks separating encoding/decoding. The above table profiles the entire MapImage#save method (which includes encode and decode).
  • Do we want to change the config layout to better allow for support of other image formats in the future (i.e. lossless/lossy webp)? Or should we leave that for when other image formats are implemented?

Configs with (effectively) default image io settings will be switched to use PNJ. Otherwise, they will continue to use BufferedImage.

Some basic testing shows that PNJ gives compression near the max setting for BufferedImage while taking less time.

The following results are for rendering the same map twice in a row (after a warmup run) averaged over a couple of runs (time), and for the whole tiles directory for the dimension (size). Time is what was spent in `MapImage#save` on the image io thread as measured by spark (async profiler).

PNJ                                            : 724K in 1400ms
BufferedImage compress-images=enabled, value=1 : 712K in 2300ms
BufferedImage compress-images=disabled         : 804K in 950ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant