Parcel: πŸ› Bundle metrics showing incorrect time

Created on 6 Mar 2018  Β·  3Comments  Β·  Source: parcel-bundler/parcel

πŸ› bug report

πŸŽ› Configuration (.babelrc, package.json, cli command)

parcel build ./examples/single-entry-med-graph-js-only/src/index.js -d ./examples/single-entry-med-graph-js-only/dist --no-minify --no-cache

πŸ€” Expected Behavior

Should show the right time

😯 Current Behavior

screen shot 2018-03-05 at 8 12 11 pm

Shows 10.44s even though it reports ✨ Built in 3.48s. above it.

Based on reasonable judgement, it doesn’t take even close to 10 seconds. Just eyeballing it, the whole thing finishes in less than 4 or 5 seconds at most.

πŸ’ Possible Solution

The bundle metrics feature was introduced in #733, so that would be a good place to start.

Bundle time get’s determined here:
https://github.com/parcel-bundler/parcel/blob/1ceb7aa791cc4a4a2291c1f78c799182f89fc111/src/Bundle.js#L137-L140

Here’s the --detailed-report:
screen shot 2018-03-05 at 8 30 41 pm

πŸ’» Code Sample

Repo: TheLarnkin/bundler-performance-benchmark

🌍 Your Environment

| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.6.2
| Node | v8.9.4
| npm/Yarn | 5.6.0/1.3.2
| Operating System | Mac OS High Sierra (10.13.2)

Good First Issue Bug Help Wanted

All 3 comments

I can take a look.

I guess the problem is the assets are builded in parallel, and the bundle time is counted in serial

Yeah @lili21 is right. You have 4 cores and 3 are used to build so 3.48s * 3 = 10.44s, see Jasper's comment on #733.

But I agree it can be confusing for most people. Maybe we should display the "parallel time" in the normal report and the "real time" in the detailled report.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

devongovett picture devongovett  Β·  3Comments

algebraic-brain picture algebraic-brain  Β·  3Comments

will-stone picture will-stone  Β·  3Comments

davidnagli picture davidnagli  Β·  3Comments

mnn picture mnn  Β·  3Comments