Fix tile loading#6
Merged
cryptobench merged 3 commits intoJan 16, 2026
Merged
Conversation
The main issue was that getBaseTileWithPixels() didn't check the disk cache before regenerating tiles. This meant that even when base tiles were cached on disk, composite tile generation would regenerate all 256 base tiles. Changes: - Add disk cache check to getBaseTileWithPixels() with PNG-to-pixel decoding - Create PngDecoder class to decode PNG bytes back to pixel arrays - Increase MAX_PIXEL_CACHE from 512 to 2048 (prevents cache thrashing) - Increase MAX_CONCURRENT_GENERATIONS from 4 to 16 (faster parallel generation) This significantly improves performance when zooming out, as cached tiles can now be reused for composite tile generation instead of regenerating.
- Add zoom event handlers to pause batching while zooming - Cancel pending/in-flight requests when zoom starts (AbortController) - Use adaptive batch delay: 150ms at zoom >= 0, 400ms at negative zoom - Don't schedule new batches during active zoom - Small delay (100ms) after zoom ends before resuming batch collection This prevents the cascade of batch requests when rapidly zooming, especially at negative zoom levels where composite tiles are expensive.
Frontend: - Reduce minNativeZoom from -4 to -3 (64 base tiles instead of 256 = 4x faster) - Users can still zoom out to -4, tiles are scaled from -3 Server: - Increase DiskIO thread pool from 2 to 6 for faster parallel reads - Add early bail-out for unexplored areas in composite tile generation - New hasAnyExploredChunks() method samples corners/center first for speed - Skip fetching 64 base tiles if area is completely unexplored
Owner
|
Thank you for you contribution. I'm merging your PR. 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello, i fixed the tile loading and tested it for me.
There you can see how fast it is for me.
https://www.dropbox.com/scl/fi/3qu6ohngyqkfsim2lrorr/brave_NOS0VhXcF1.mp4?rlkey=0ymo6web2eei1qm0nqidm33ms&raw=1