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

enable hoist_props by default #2492

Merged
merged 1 commit into from
Nov 19, 2017
Merged

Conversation

alexlamsl
Copy link
Collaborator

/cc @kzc

@alexlamsl
Copy link
Collaborator Author

node test/benchmark.js

`master` #2492
https://code.jquery.com/jquery-3.2.1.js
- parse: 0.203s
- compress: 1.062s
- scope: 0.047s
- mangle: 0.141s
- properties: 0.000s
- output: 0.078s
- total: 1.531s

Original: 268039 bytes
Uglified: 86732 bytes
GZipped:  30331 bytes
SHA1 sum: 978ec65a00f98a68cfe673f1b8c4d1b83e972f41

https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.4/angular.js
- parse: 0.312s
- compress: 1.844s
- scope: 0.109s
- mangle: 0.203s
- properties: 0.000s
- output: 0.157s
- total: 2.625s

Original: 1249863 bytes
Uglified: 174056 bytes
GZipped:  60368 bytes
SHA1 sum: 807303c20e04da2bb4ad9a1e11dee2bb836dac82

https://cdnjs.cloudflare.com/ajax/libs/mathjs/3.9.0/math.js
- parse: 0.656s
- compress: 3.890s
- scope: 0.157s
- mangle: 0.375s
- properties: 0.000s
- output: 0.297s
- total: 5.375s

Original: 1590107 bytes
Uglified: 467712 bytes
GZipped:  118990 bytes
SHA1 sum: 3a51535a2cf02ab8165fec634470749da6e14e14

https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.js
- parse: 0.062s
- compress: 0.344s
- scope: 0.015s
- mangle: 0.063s
- properties: 0.000s
- output: 0.047s
- total: 0.531s

Original: 69707 bytes
Uglified: 36833 bytes
GZipped:  9683 bytes
SHA1 sum: bf8c46ddfb05ad98cd4e148038849b5bf2de3fe8

https://unpkg.com/react@15.3.2/dist/react.js
- parse: 0.281s
- compress: 1.687s
- scope: 0.078s
- mangle: 0.266s
- properties: 0.000s
- output: 0.172s
- total: 2.484s

Original: 701412 bytes
Uglified: 205600 bytes
GZipped:  62173 bytes
SHA1 sum: 3123b2e06f0088e213c004fb8b7df90314756629

http://builds.emberjs.com/tags/v2.11.0/ember.prod.js
- parse: 0.406s
- compress: 2.490s
- scope: 0.172s
- mangle: 0.375s
- properties: 0.000s
- output: 0.265s
- total: 3.708s

Original: 1852178 bytes
Uglified: 526640 bytes
GZipped:  128514 bytes
SHA1 sum: 0b89d985f7cb9d385c02dc5b9c04b3919d3e61dd

https://cdn.jsdelivr.net/lodash/4.17.4/lodash.js
- parse: 0.140s
- compress: 2.031s
- scope: 0.063s
- mangle: 0.187s
- properties: 0.000s
- output: 0.125s
- total: 2.546s

Original: 539590 bytes
Uglified: 69943 bytes
GZipped:  24352 bytes
SHA1 sum: 6e3f369cffa7b58f51e07507fd09f92e4c31a4a7

https://cdnjs.cloudflare.com/ajax/libs/d3/4.5.0/d3.js
- parse: 0.296s
- compress: 2.719s
- scope: 0.110s
- mangle: 0.312s
- properties: 0.000s
- output: 0.156s
- total: 3.593s

Original: 451131 bytes
Uglified: 211723 bytes
GZipped:  70943 bytes
SHA1 sum: 5cc6b6d0980b75886e701451715456a3e965d20d
https://code.jquery.com/jquery-3.2.1.js
- parse: 0.250s
- compress: 1.218s
- scope: 0.063s
- mangle: 0.125s
- properties: 0.000s
- output: 0.109s
- total: 1.765s

Original: 268039 bytes
Uglified: 86732 bytes
GZipped:  30331 bytes
SHA1 sum: 978ec65a00f98a68cfe673f1b8c4d1b83e972f41

https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.4/angular.js
- parse: 0.421s
- compress: 2.219s
- scope: 0.125s
- mangle: 0.250s
- properties: 0.000s
- output: 0.156s
- total: 3.171s

Original: 1249863 bytes
Uglified: 173992 bytes
GZipped:  60317 bytes
SHA1 sum: b0e09d6d7228ab938092bfb4aa22ab6a58c9cd83

https://cdnjs.cloudflare.com/ajax/libs/mathjs/3.9.0/math.js
- parse: 0.750s
- compress: 4.234s
- scope: 0.156s
- mangle: 0.368s
- properties: 0.000s
- output: 0.359s
- total: 5.867s

Original: 1590107 bytes
Uglified: 467712 bytes
GZipped:  118990 bytes
SHA1 sum: 3a51535a2cf02ab8165fec634470749da6e14e14

https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.js
- parse: 0.109s
- compress: 0.422s
- scope: 0.015s
- mangle: 0.063s
- properties: 0.000s
- output: 0.031s
- total: 0.640s

Original: 69707 bytes
Uglified: 36833 bytes
GZipped:  9683 bytes
SHA1 sum: bf8c46ddfb05ad98cd4e148038849b5bf2de3fe8

https://unpkg.com/react@15.3.2/dist/react.js
- parse: 0.375s
- compress: 1.890s
- scope: 0.078s
- mangle: 0.203s
- properties: 0.000s
- output: 0.141s
- total: 2.687s

Original: 701412 bytes
Uglified: 205404 bytes
GZipped:  62134 bytes
SHA1 sum: e5bb8db948062137195b7e4e41c4696313a5427e

http://builds.emberjs.com/tags/v2.11.0/ember.prod.js
- parse: 0.718s
- compress: 3.219s
- scope: 0.188s
- mangle: 0.343s
- properties: 0.000s
- output: 0.266s
- total: 4.734s

Original: 1852178 bytes
Uglified: 526640 bytes
GZipped:  128514 bytes
SHA1 sum: 0b89d985f7cb9d385c02dc5b9c04b3919d3e61dd

https://cdn.jsdelivr.net/lodash/4.17.4/lodash.js
- parse: 0.234s
- compress: 2.219s
- scope: 0.047s
- mangle: 0.156s
- properties: 0.000s
- output: 0.078s
- total: 2.734s

Original: 539590 bytes
Uglified: 69943 bytes
GZipped:  24352 bytes
SHA1 sum: 6e3f369cffa7b58f51e07507fd09f92e4c31a4a7

https://cdnjs.cloudflare.com/ajax/libs/d3/4.5.0/d3.js
- parse: 0.468s
- compress: 3.032s
- scope: 0.109s
- mangle: 0.250s
- properties: 0.000s
- output: 0.172s
- total: 4.031s

Original: 451131 bytes
Uglified: 211723 bytes
GZipped:  70943 bytes
SHA1 sum: 5cc6b6d0980b75886e701451715456a3e965d20d

@kzc
Copy link
Contributor

kzc commented Nov 18, 2017

LGTM

It has a small but positive effect here, but it will make more of an impact on scope hoisting bundlers.

@egoroof
Copy link

egoroof commented Nov 18, 2017

Should the readme be updated too?

@kzc
Copy link
Contributor

kzc commented Nov 18, 2017

--- a/README.md
+++ b/README.md
@@ -635 +635 @@ If you're using the `X-SourceMap` header instead, you can just omit `sourceMap.u
-- `hoist_props` (default: `false`) -- hoist properties from constant object and
+- `hoist_props` (default: `true`) -- hoist properties from constant object and

@alexlamsl
Copy link
Collaborator Author

Thanks - README.md updated in 22bf837

option is disabled. Does not negatively impact other major browsers.

Copy link
Contributor

Choose a reason for hiding this comment

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

The github builtin editor appears to add those trailing spaces.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not to worry - VSCode will pick up the slack 😉

@alexlamsl alexlamsl merged commit b80062c into mishoo:master Nov 19, 2017
@alexlamsl alexlamsl deleted the hoist_props branch November 19, 2017 06:56
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