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

Improve V8-specific performance #49

Open
mathiasbynens opened this issue Jun 23, 2016 · 0 comments
Open

Improve V8-specific performance #49

mathiasbynens opened this issue Jun 23, 2016 · 0 comments

Comments

@mathiasbynens
Copy link
Owner

mathiasbynens commented Jun 23, 2016

@bnoordhuis posted some excellent ideas here:

For example, .toASCII() calls String#split() twice and is heavy on the map-over-substrings idiom. It would probably be faster to:

  1. Scan for the split character and only split when found; saves allocating an array in the common case.
  2. Iterate rather than map; V8 is not great at lowering/inlining callbacks.
  3. Try to avoid concatenating strings too much; cons strings eventually have to be flattened.

There is probably more but that is what stood out from a quick look.

Patches welcome.

cc @trevnorris

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