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 diffStyles output to Worker#updateLayers, rather than complete style layers info #3650

Open
anandthakker opened this issue Nov 17, 2016 · 0 comments
Labels
performance ⚡ Speed, stability, CPU usage, memory usage, or power usage

Comments

@anandthakker
Copy link
Contributor

Followup to #3621

By adding code analogous to Style#setState on the Worker, we could reduce (sometimes significantly, I think) the amount of data that needs to be sent to workers for an updateLayers operation.

In fact, a nice way to do this would be:

  • Pare Style's responsibilities down exclusively to state management (maybe renaming it to StyleState or some such). This means extracting stuff like SourceCache management, Worker updates, etc. to a higher level parent module, instead emitting state change events that the parent object could use to do the SourceCache/Worker/etc. updating stuff.
  • Replace StyleLayerIndex with StyleState (adding an option allowing the worker to disable validation), and pull out the part of setState that actually applies the diff operations into a separate method.
  • In StyleState, emit the diffStyles operations that were applied as part of the payload for the state change events, so that updateWorkers can just send that instead of the serialized style layers.
@mourner mourner added the performance ⚡ Speed, stability, CPU usage, memory usage, or power usage label Apr 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance ⚡ Speed, stability, CPU usage, memory usage, or power usage
Projects
None yet
Development

No branches or pull requests

2 participants