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

Feature: Enable opt-out of minified, gzip calculations. #230

Merged
merged 7 commits into from
Jan 23, 2018

Conversation

ryan-roemer
Copy link
Member

Overview

This PR adds minified and gzip configuration options that can optionally disable the relatively expensive per-module calculations of each by inspectpack under the hood.

  • Fixes multiple node progress in Activity Monitor #227
  • Adds minified and gzip plugin options, both defaulted to true so we don't need a semver major bump.
  • Adds more README documentation and explanations about CPU intensive workloads and the inspectpack cache.

/cc @kenwheeler @tptee

Sample Results

I took a previous project opened for bug diagnosis with a reasonably-sized app, and compared outputs, stats and execution times:

(Baseline) master

┌──Modules───────────────────────────────────────────────────────────────────────────────────────────┐┌──Assets────────────────────────────────────────────────────────────────────────────────────────────┐
│                                                                                                    ││                                                                                                    │
│   1:vendor.js    2:app.js    3:style.js    4:polyfills.js    5:vendorDll.dll.js    6:polyfills.dll ││                                                                                                    │
│                                                                                                    ││  Name                                           Size                                               │
│  Name                                     Size (min+gz)               Percentage                   ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││  style.js.map                                   606 B                                              │
│  sockjs-client                            24.7 KB                     41.4%                        ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││  vendor.js                                      635 B (min+gz)                                     │
│  html-entities                            14.46 KB                    24.2%                        ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││  style.js                                       235 B (min+gz)                                     │
│  json3                                    3.35 KB                     5.61%                        ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    │└────────────────────────────────────────────────────────────────────────────────────────────────────┘
│  url                                      2.89 KB                     4.83%                        │┌─Problems───────────────────────────────────────────────────────────────────────────────────────────┐
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││  1:vendor.js    2:app.js    3:style.js    4:polyfills.js    5:vendorDll.dll.js    6:polyfills.dll.j│
│  (webpack)-dev-server                     2.26 KB                     3.79%                        ││                                                                                                    │
│                                                                                                    ││  No problems detected!                                                                             │
│                                                                                                    ││                                                                                                    │
│  url-parse                                1.76 KB                     2.95%                        ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│  debug                                    1.56 KB                     2.61%                        ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│  (webpack)                                1.48 KB                     2.48%                        ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│  punycode                                 1.36 KB                     2.27%                        ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│  events                                   1.11 KB                     1.86%                        ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
└────────────────────────────────────────────────────────────────────────────────────────────────────┘└────────────────────────────────────────────────────────────────────────────────────────────────────┘

no optimizations

  • Setting: "minified":false,"gzip":false
  • Uncached time for sizes calculation: 12615 ms
  • Cached time for sizes calculation: 2555 ms
┌──Modules───────────────────────────────────────────────────────────────────────────────────────────┐┌──Assets────────────────────────────────────────────────────────────────────────────────────────────┐
│                                                                                                    ││                                                                                                    │
│   1:vendor.js    2:app.js    3:style.js    4:polyfills.js    5:vendorDll.dll.js    6:polyfills.dll ││                                                                                                    │
│                                                                                                    ││  Name                                               Size                                           │
│  Name                                       Size                      Percentage                   ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││  style.js.map                                       606 B                                          │
│  sockjs-client                              117.95 KB                 35.9%                        ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││  vendor.js                                          34.42 KB                                       │
│  html-entities                              57.87 KB                  17.6%                        ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││  style.js                                           1.71 KB                                        │
│  json3                                      42.94 KB                  13.1%                        ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    │└────────────────────────────────────────────────────────────────────────────────────────────────────┘
│  url                                        23.36 KB                  7.11%                        │┌─Problems───────────────────────────────────────────────────────────────────────────────────────────┐
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││  1:vendor.js    2:app.js    3:style.js    4:polyfills.js    5:vendorDll.dll.js    6:polyfills.dll.j│
│  punycode                                   14.82 KB                  4.51%                        ││                                                                                                    │
│                                                                                                    ││  No problems detected!                                                                             │
│                                                                                                    ││                                                                                                    │
│  url-parse                                  13.05 KB                  3.97%                        ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│  (webpack)-dev-server                       12.55 KB                  3.82%                        ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│  debug                                      9.33 KB                   2.84%                        ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│  events                                     8.17 KB                   2.49%                        ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│  loglevel                                   7.99 KB                   2.43%                        ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
└────────────────────────────────────────────────────────────────────────────────────────────────────┘└────────────────────────────────────────────────────────────────────────────────────────────────────┘

min

  • Setting: "minified":true,"gzip":false
  • Uncached time for sizes calculation: 65875 ms
  • Cached time for sizes calculation: 2270 ms
┌──Modules───────────────────────────────────────────────────────────────────────────────────────────┐┌──Assets────────────────────────────────────────────────────────────────────────────────────────────┐
│                                                                                                    ││                                                                                                    │
│   1:vendor.js    2:app.js    3:style.js    4:polyfills.js    5:vendorDll.dll.js    6:polyfills.dll ││                                                                                                    │
│                                                                                                    ││  Name                                            Size                                              │
│  Name                                      Size (min)                Percentage                    ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││  style.js.map                                    606 B                                             │
│  sockjs-client                             52.74 KB                  36.8%                         ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││  vendor.js                                       3.31 KB (min)                                     │
│  html-entities                             46.39 KB                  32.4%                         ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││  style.js                                        360 B (min)                                       │
│  json3                                     7.9 KB                    5.52%                         ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    │└────────────────────────────────────────────────────────────────────────────────────────────────────┘
│  url                                       7.62 KB                   5.32%                         │┌─Problems───────────────────────────────────────────────────────────────────────────────────────────┐
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││  1:vendor.js    2:app.js    3:style.js    4:polyfills.js    5:vendorDll.dll.js    6:polyfills.dll.j│
│  (webpack)-dev-server                      4.82 KB                   3.37%                         ││                                                                                                    │
│                                                                                                    ││  No problems detected!                                                                             │
│                                                                                                    ││                                                                                                    │
│  url-parse                                 3.63 KB                   2.54%                         ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│  events                                    3.48 KB                   2.43%                         ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│  debug                                     3.08 KB                   2.15%                         ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│  (webpack)                                 2.59 KB                   1.81%                         ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│  punycode                                  2.54 KB                   1.77%                         ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
└────────────────────────────────────────────────────────────────────────────────────────────────────┘└────────────────────────────────────────────────────────────────────────────────────────────────────┘

min+gz

  • Setting: "minified":true,"gzip":true
  • Uncached time for sizes calculation: 82141 ms
  • Cached time for sizes calculation: 2671 ms
┌──Modules───────────────────────────────────────────────────────────────────────────────────────────┐┌──Assets────────────────────────────────────────────────────────────────────────────────────────────┐
│                                                                                                    ││                                                                                                    │
│   1:vendor.js    2:app.js    3:style.js    4:polyfills.js    5:vendorDll.dll.js    6:polyfills.dll ││                                                                                                    │
│                                                                                                    ││  Name                                           Size                                               │
│  Name                                     Size (min+gz)               Percentage                   ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││  style.js.map                                   606 B                                              │
│  sockjs-client                            24.7 KB                     41.4%                        ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││  vendor.js                                      635 B (min+gz)                                     │
│  html-entities                            14.46 KB                    24.2%                        ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││  style.js                                       235 B (min+gz)                                     │
│  json3                                    3.35 KB                     5.61%                        ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    │└────────────────────────────────────────────────────────────────────────────────────────────────────┘
│  url                                      2.89 KB                     4.83%                        │┌─Problems───────────────────────────────────────────────────────────────────────────────────────────┐
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││  1:vendor.js    2:app.js    3:style.js    4:polyfills.js    5:vendorDll.dll.js    6:polyfills.dll.j│
│  (webpack)-dev-server                     2.26 KB                     3.79%                        ││                                                                                                    │
│                                                                                                    ││  No problems detected!                                                                             │
│                                                                                                    ││                                                                                                    │
│  url-parse                                1.76 KB                     2.95%                        ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│  debug                                    1.56 KB                     2.61%                        ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│  (webpack)                                1.48 KB                     2.48%                        ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│  punycode                                 1.36 KB                     2.27%                        ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│  events                                   1.11 KB                     1.86%                        ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
│                                                                                                    ││                                                                                                    │
└────────────────────────────────────────────────────────────────────────────────────────────────────┘└────────────────────────────────────────────────────────────────────────────────────────────────────┘

@ryan-roemer ryan-roemer changed the title Feature/opt in inspectpack Feature: Enable opt-out of minified, gzip calculations. Jan 22, 2018
@kenwheeler
Copy link
Contributor

This is dank!

@ryan-roemer ryan-roemer merged commit 7f99b31 into master Jan 23, 2018
@ryan-roemer ryan-roemer deleted the feature/opt-in-inspectpack branch January 23, 2018 16:38
@ryan-roemer
Copy link
Member Author

Released in webpack-dashboard@1.1.0

Notes: https://github.com/FormidableLabs/webpack-dashboard/releases/tag/v1.1.0

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

2 participants