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

🐛 Bundle metrics showing incorrect time #949

Closed
davidnagli opened this issue Mar 6, 2018 · 3 comments
Closed

🐛 Bundle metrics showing incorrect time #949

davidnagli opened this issue Mar 6, 2018 · 3 comments

Comments

@davidnagli
Copy link
Contributor

🐛 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:

parcel/src/Bundle.js

Lines 137 to 140 in 1ceb7aa

this.bundleTime = Date.now() - startTime;
for (let asset of this.assets) {
this.bundleTime += asset.buildTime;
}

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)
@lili21
Copy link
Contributor

lili21 commented Mar 6, 2018

I can take a look.

@lili21
Copy link
Contributor

lili21 commented Mar 6, 2018

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

@fathyb
Copy link
Contributor

fathyb commented Mar 6, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants