-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Better estimation of asset sizes #20927
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
Conversation
Development AssetsDiff --- main/out.txt 2025-06-11 01:12:44.000000000 +0000
+++ pr/./pr-15601693379/out.txt 2025-06-12 04:34:40.000000000 +0000
@@ -1,98 +1,62 @@
-2.2M └─┬ .
-996K ├─┬ @ember
-187K │ ├─┬ -internals
- 50K │ │ ├─┬ views
- 46K │ │ │ └─┬ lib
- 21K │ │ │ ├── system
- 10K │ │ │ ├── views
-5.6K │ │ │ ├── mixins
-4.3K │ │ │ └── compat
- 35K │ │ ├─┬ runtime
- 30K │ │ │ └─┬ lib
- 21K │ │ │ ├── mixins
-5.7K │ │ │ └── ext
- 26K │ │ ├─┬ meta
- 21K │ │ │ └── lib
- 11K │ │ ├── owner
-9.4K │ │ ├── deprecations
-7.4K │ │ ├── metal
-7.0K │ │ ├── string
-5.0K │ │ ├── glimmer
-4.9K │ │ ├── utils
-4.9K │ │ ├── routing
-4.5K │ │ ├── error-handling
-4.5K │ │ ├── utility-types
-4.2K │ │ ├── container
-4.2K │ │ ├── browser-environment
-4.1K │ │ └── environment
-183K │ ├─┬ routing
- 28K │ │ └── lib
-149K │ ├─┬ object
- 66K │ │ └─┬ lib
- 62K │ │ └── computed
-114K │ ├─┬ template-compiler
-109K │ │ └─┬ lib
- 20K │ │ ├── plugins
-4.6K │ │ ├── system
-4.1K │ │ └── -internal
- 65K │ ├─┬ application
-5.6K │ │ └── lib
- 52K │ ├─┬ debug
- 21K │ │ └── lib
- 38K │ ├─┬ array
-4.9K │ │ └── lib
- 31K │ ├─┬ engine
-4.7K │ │ └── lib
- 27K │ ├── runloop
- 22K │ ├─┬ utils
- 18K │ │ └── lib
- 20K │ ├── helper
- 11K │ ├── destroyable
-9.8K │ ├── instrumentation
-9.4K │ ├── controller
-7.4K │ ├── service
-7.2K │ ├── owner
-6.2K │ ├── component
-5.6K │ ├── canary-features
-5.5K │ ├── modifier
-5.1K │ ├── template-compilation
-5.0K │ ├── enumerable
-5.0K │ ├── test
-4.4K │ ├── template
-4.4K │ ├── renderer
-4.2K │ ├── deprecated-features
-4.1K │ ├── template-factory
-4.1K │ └── version
-722K ├── shared-chunks
-384K ├─┬ @glimmer
-166K │ ├── runtime
- 60K │ ├── opcode-compiler
- 30K │ ├── manager
- 22K │ ├── validator
- 14K │ ├── program
- 12K │ ├── reference
- 11K │ ├── destroyable
- 10K │ ├─┬ tracking
-4.4K │ │ └── primitives
- 10K │ ├── util
-8.1K │ ├── node
-7.3K │ ├── global-context
-6.4K │ ├── wire-format
-5.0K │ ├── vm
-4.9K │ ├── encoder
-4.6K │ ├── owner
-4.1K │ └── env
- 60K ├─┬ ember-testing
- 55K │ └─┬ lib
- 14K │ ├── test
- 14K │ ├── helpers
- 10K │ ├── ext
-6.4K │ └── adapters
- 31K ├── backburner.js
- 25K ├── ember
- 24K ├── route-recognizer
- 18K ├─┬ @simple-dom
- 14K │ └── document
-9.2K ├── dag-map
-4.3K ├── rsvp
-4.3K └── router_js
+╔═══════╤══════════╤═══════════╗
+║ │ Min │ Gzip ║
+╟───────┼──────────┼───────────╢
+║ Total │ 409.3 KB │ 228.73 KB ║
+╚═══════╧══════════╧═══════════╝
+
+╔══════════════════════╤═══════════╤═══════════╗
+║ @ember/* │ Min │ Gzip ║
+╟──────────────────────┼───────────┼───────────╢
+║ Total │ 239.69 KB │ 147.05 KB ║
+╟──────────────────────┼───────────┼───────────╢
+║ -internals │ 35.92 KB │ 25.65 KB ║
+║ application │ 12.83 KB │ 7.58 KB ║
+║ array │ 12.66 KB │ 7.32 KB ║
+║ canary-features │ 304 B │ 405 B ║
+║ component │ 1.07 KB │ 995 B ║
+║ controller │ 1.8 KB │ 1.36 KB ║
+║ debug │ 11.4 KB │ 7.87 KB ║
+║ deprecated-features │ 31 B │ 77 B ║
+║ destroyable │ 561 B │ 383 B ║
+║ enumerable │ 259 B │ 387 B ║
+║ helper │ 823 B │ 615 B ║
+║ instrumentation │ 2.43 KB │ 1.78 KB ║
+║ modifier │ 669 B │ 605 B ║
+║ object │ 33.78 KB │ 20.82 KB ║
+║ owner │ 159 B │ 178 B ║
+║ renderer │ 385 B │ 344 B ║
+║ routing │ 58.05 KB │ 33.12 KB ║
+║ runloop │ 2.2 KB │ 1.41 KB ║
+║ service │ 859 B │ 741 B ║
+║ template │ 396 B │ 342 B ║
+║ template-compilation │ 429 B │ 366 B ║
+║ template-compiler │ 57.81 KB │ 30.44 KB ║
+║ template-factory │ 94 B │ 160 B ║
+║ test │ 923 B │ 627 B ║
+║ utils │ 3.93 KB │ 3.51 KB ║
+║ version │ 55 B │ 131 B ║
+╚══════════════════════╧═══════════╧═══════════╝
+
+╔═════════════════╤═══════════╤══════════╗
+║ @glimmer/* │ Min │ Gzip ║
+╟─────────────────┼───────────┼──────────╢
+║ Total │ 169.61 KB │ 81.69 KB ║
+╟─────────────────┼───────────┼──────────╢
+║ destroyable │ 2.7 KB │ 1.35 KB ║
+║ encoder │ 596 B │ 653 B ║
+║ env │ 38 B │ 87 B ║
+║ global-context │ 886 B │ 545 B ║
+║ manager │ 12.19 KB │ 5.44 KB ║
+║ node │ 2.71 KB │ 1.81 KB ║
+║ opcode-compiler │ 29.89 KB │ 13.23 KB ║
+║ owner │ 159 B │ 202 B ║
+║ program │ 7.1 KB │ 3.63 KB ║
+║ reference │ 5.51 KB │ 3.18 KB ║
+║ runtime │ 95.26 KB │ 42.51 KB ║
+║ tracking │ 989 B │ 972 B ║
+║ util │ 3.03 KB │ 2.29 KB ║
+║ validator │ 6 KB │ 3.72 KB ║
+║ vm │ 784 B │ 798 B ║
+║ wire-format │ 1.84 KB │ 1.35 KB ║
+╚═════════════════╧═══════════╧══════════╝
+Details
|
…ugh uncompress matches compression's input
| - name: Install Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 18 |
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.
18 has been EOL'd, but I don't want to drop 18 support in this PR
| // lgwin: 22, // window size | ||
| }); | ||
|
|
||
| // console.log(brotli.decompress(brotli.compress(result.code)).length, result.code.length); |
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.
I feel like I'm missing something about brotli, because decompressing compressed code results in the same length of code.
but the numbers were just... unreal
package.json
Outdated
| { | ||
| "name": "ember-source", | ||
| "version": "6.7.0-alpha.1", | ||
| "version": "6.7.0-alpha.1.nvp-asset-sizes+ad603139", |
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.
?
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.
removed in latest push. happens when you run pnpm build or build-for-production -- i forget which
package.json
Outdated
| "packageManager": "[email protected]", | ||
| "_originalVersion": "6.7.0-alpha.1", | ||
| "_versionPreviouslyCalculated": true, | ||
| "publishConfig": { |
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.
I don't think we want this
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.
aye, it was removed in the latest push
kategengler
left a comment
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.
You should consider making a github action for this -- it would let the deps be isolated.
See example here (on my fork): NullVoxPopuli#7 (comment)
i dunno if it needs said, but these numbers are if you use every module in your app -- which .. most folks will not be using (runtime compiler?)
Also, this excludes our third-party deps, such as router_js, @simple-dom, etc (these are very tiny)
Copied here:
Estimated Asset Sizes
Diff
Details