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

Faster TextTemplateParser [Chrome] #238

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

FWeinb
Copy link

@FWeinb FWeinb commented Nov 26, 2013

I was playing with RegEx so i tried to come up with a RegEx way of
handling the TextTemplate in Rivets. And (at least in Chrome) the
solution is nearly twice as fast.

You can find the perf test here: http://jsperf.com/parse-string-regex

It’s is quite astonishing how much better V8 can handle regular
expressions.

If other browser catch up with the RegEx performance this could be a better solution.

I was playing with RegEx so i tried to come up with a RegEx way of
handeling the TextTemplate in Rivets. And (at least in Chrome) the
solution is nearly twice as fast.

You can find the perf test here: http://jsperf.com/parse-string-regex

It’s is quite astonishing how much better V8 can handel regular
expressions.
@jhnns
Copy link
Contributor

jhnns commented Nov 28, 2013

It would also be faster to cache the regex that has once been compiled.

@mikeric
Copy link
Owner

mikeric commented Aug 2, 2014

@FWeinb Thanks for the pull request. Seems like Safari 7 is still behind with this, the "Parse by Hand" code runs much faster in Safari, but the "Simple Regex II" runs even faster in Chrome. Tough decision to merge this, will keep it open for now.

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

Successfully merging this pull request may close these issues.

None yet

3 participants