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

avoid string concat #11

Closed
leeoniya opened this issue Mar 20, 2024 · 1 comment
Closed

avoid string concat #11

leeoniya opened this issue Mar 20, 2024 · 1 comment

Comments

@leeoniya
Copy link
Owner

i think it will reduce mem use a lot if we just .slice() from start to end and do a .replaceAll() to remove the escaped commas or quotes. not sure this can work for incremental parsing but probably. think this will increase overall perf as well since mem alloc / GC is the slowest thing in JS.

@leeoniya leeoniya changed the title avoid sting concat avoid string concat Mar 20, 2024
@leeoniya
Copy link
Owner Author

leeoniya commented Mar 25, 2024

done.

this actually lost some perf. i was able to get some of it back, but not all. net loss it maybe up to 10%, depending on corpus.

in Node/V8 it's a small improvement in mem, but in Bun/JSC it's a huge mem reduction (>50%).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant