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

Optimize StructArray views #11443

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Optimize StructArray views #11443

wants to merge 3 commits into from

Conversation

mourner
Copy link
Member

@mourner mourner commented Jan 26, 2022

A small experiment to see if potential optimizations to StructArray (which is on a hot path) could make a difference to load time:

  • Do not create uint8 view when members don't use it; instead, use the smallest used view for resizing array buffers.
  • Cache view variables in emplace.

Will report back once the benchmarks finish.

Launch Checklist

  • briefly describe the changes in this PR
  • write tests for all new functionality
  • post benchmark scores
  • manually test the debug page
  • apply changelog label ('bug', 'feature', 'docs', etc) or use the label 'skip changelog'
  • add an entry inside this element for inclusion in the mapbox-gl-js changelog: <changelog></changelog>

@mourner mourner added the performance ⚡ Speed, stability, CPU usage, memory usage, or power usage label Jan 26, 2022
@mourner
Copy link
Member Author

mourner commented Jan 31, 2022

@ansis here's the benchmark run for these https://sites.mapbox.com/benchmap-js-staging2-site/runs/436 — not sure if worth landing, but it does decrease total number of objects in memory.

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

Successfully merging this pull request may close these issues.

None yet

1 participant