Skip to content

Avoid full string scan in generateCSSRuleset#206

Merged
xymostech merged 1 commit into
Khan:masterfrom
lencioni:string-start
Mar 6, 2017
Merged

Avoid full string scan in generateCSSRuleset#206
xymostech merged 1 commit into
Khan:masterfrom
lencioni:string-start

Conversation

@lencioni

@lencioni lencioni commented Mar 5, 2017

Copy link
Copy Markdown
Collaborator

Bracket access is a better choice here. This probably won't have a huge
impact, but I don't see any reason to not do it.

JSPerf shows this to be about 25% faster, and I assume the performance
difference is even better as the string gets longer:

https://jsperf.com/test-start-of-string/1

Bracket access is a better choice here. This probably won't have a huge
impact, but I don't see any reason to not do it.

JSPerf shows this to be about 25% faster, and I assume the performance
difference is even better as the string gets longer:

  https://jsperf.com/test-start-of-string/1

@xymostech xymostech left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is going away in #200 anyway but this looks fine. :)

@xymostech xymostech merged commit 7c1e609 into Khan:master Mar 6, 2017
@lencioni lencioni deleted the string-start branch March 6, 2017 22:54
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.

2 participants