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
Turn on more aggressive compiler optimizations. #3223
Conversation
25KB pre-gzip win on v0.js :) |
woot, good stuff. |
@cramforce guessing this would also have an improvement on eval time? |
bcd762e
to
6d61eb1
Compare
Got another 4KB improvement. |
@erwinmombay Please take a look. I removed the property renaming from this change. Little size impact, but having the externs in place and such will make the next change easier. |
I guess 10K pre-gzip on main binary is still kinda worth it anyway :) |
// AMP's globals | ||
window.AMP_TEST; | ||
window.AMP_TAG; | ||
window.AMP = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to add window.AMP_CONFIG
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
c4c0982
to
079f063
Compare
@cramforce LGTM |
812a753
to
6e0fd8d
Compare
- allows devirtualization of private methods. - allows renaming of private properties and methods. - Aliases `.prototype.` pattern where useful. - other less important optimizations. Implements a coding convention for AMP that marks all properties not ending in `_` as exported (so they can travel between compilation units). This change by itself has little size impact, but should make our code quite a bit tighter to execute, because many virtual private method calls because function calls. Primarily this is a preparation to turn on private property renaming when the upstream change lands in closure compiler.
…coding convention. This is a slight change in behavior for projects based on the GoogleCodingConvention that considers properties starting with "_" to be exported, which should be very rare under this convention. Compiler change prototyped in ampproject/amphtml#3223 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=124020030
.prototype.
pattern where useful.Implements a coding convention for AMP that marks all properties not ending in
_
as exported (so they can travel between compilation units).
This change by itself has little size impact, but should make our code quite a bit tighter to execute, because many virtual p
rivate method calls because function calls. Primarily this is a preparation to turn on private property renaming when the ups
tream change lands in closure compiler.