This repository was archived by the owner on Apr 12, 2024. It is now read-only.
chore($parse): convert parser() and lex() to prototype-based code#3681
Closed
jankuca wants to merge 1 commit intoangular:masterfrom
Closed
chore($parse): convert parser() and lex() to prototype-based code#3681jankuca wants to merge 1 commit intoangular:masterfrom
jankuca wants to merge 1 commit intoangular:masterfrom
Conversation
Contributor
|
What is the reason for this change? The resulting code will not minify as well and there is minimal impact to performance since expression get cached, so the cost of expression parsing is not that significant. I would like to see what impact this has on minified code. |
Contributor
|
it adds 45 bytes after gzip == insignificant |
jamesdaily
pushed a commit
to jamesdaily/angular.js
that referenced
this pull request
Jan 27, 2014
This reduces memory consumption of parsed angular expressions and speeds up parsing. This JSPerf case demonstrates the performance boost: http://jsperf.com/closure-vs-prototype-ngparser Chrome: 1.5–2x boost FF: slightly slower (I would love to know why) IE: 4x boost To be clear, this doesn't have any impact on runtime performance of expressions as demostrated in this JSPerf: http://jsperf.com/angular-parser-changes Closes angular#3681
jamesdaily
pushed a commit
to jamesdaily/angular.js
that referenced
this pull request
Jan 27, 2014
This reduces memory consumption of parsed angular expressions and speeds up parsing. This JSPerf case demonstrates the performance boost: http://jsperf.com/closure-vs-prototype-ngparser Chrome: 1.5–2x boost FF: slightly slower (I would love to know why) IE: 4x boost To be clear, this doesn't have any impact on runtime performance of expressions as demostrated in this JSPerf: http://jsperf.com/angular-parser-changes Closes angular#3681
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I refactored most of the
$parsecode into prototypes for performance. The improvement is in extracting all the helper functions fromparser()andlex()so that only one set of these is in use rather than a new one being created on each run. State is now shared viathis.This JSPerf case demonstrates the performance boost: http://jsperf.com/closure-vs-prototype-ngparser