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

Use a stack-based vec type instead of String in building the VLQ encoded bits #1

Open
mtolmacs opened this issue Apr 19, 2023 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@mtolmacs
Copy link
Owner

Background

There is a tight loop within WASM::generate where mappings are built and VQL encoded, which currently uses String. However String is heap allocated, which means a ton of small allocations. Since there is a practical limit of how long the mappings usually are, we can use a stack-based vec type (arrayvec, tinyvec, smallvec or the like) to avoid these allocations completely.

Success

Expected at least 50% mapping speedup based on previous experiments with heap vs stack allocated vec types.

@mtolmacs mtolmacs added enhancement New feature or request good first issue Good for newcomers labels Apr 19, 2023
@mtolmacs
Copy link
Owner Author

Inspiration for stack-based string: servo/tendril

@mtolmacs mtolmacs mentioned this issue Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant