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

Send only style ids to web workers when decoding vector tiles #107

Open
Maximkaaa opened this issue Jan 18, 2025 · 0 comments
Open

Send only style ids to web workers when decoding vector tiles #107

Maximkaaa opened this issue Jan 18, 2025 · 0 comments
Labels
A-performance OS-web T-enhancement Improve an existing feature

Comments

@Maximkaaa
Copy link
Owner

The API of TileProcessor is designed to allow registering vector tiles style and then operating only on its id. This is done in particular to optimize data transfer when doing tile decoding in the web workers. Since the memory cannot be shared between the main process and the web worker (for now at least), we want to serialize and send as little data as possible.

At the moment style is being sent in full with every tile to be decoded. Instead, we want to send the styles only when they are registered and then with the tiles send only style id.

This would require some kind of synchronization in WebWorkerVtProcessor as add_style and drop_style methods are synchronous, but process_tile is async. There must not be a situation when adding a style is called, then we ask to process a tile but the web worker doesn't have the style yet so it responds with an error.

@Maximkaaa Maximkaaa added A-performance OS-web T-enhancement Improve an existing feature labels Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-performance OS-web T-enhancement Improve an existing feature
Projects
None yet
Development

No branches or pull requests

1 participant