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

Significant perf regression in version 2.21.0 with Webpack v4 #313

Closed
1 task
Chevelleboyer opened this issue Feb 9, 2023 · 4 comments
Closed
1 task
Labels
bug Something isn't working pending triage

Comments

@Chevelleboyer
Copy link
Contributor

Chevelleboyer commented Feb 9, 2023

Bug description

A few weeks ago a colleague of mine opened issue #298 regarding the explicit dependency on webpack-sources@1.4.3 for Webpack v4. It was resolved in esbuild-loader v2.21.0, thank you so much!

After upgrading to esbuild-loader v2.21.0, however, we noticed a significant slow down in Webpack build times. Our build times have almost doubled :( When downgrading to version 2.20.0 we see the build times improve again.

Do the fixes in v2.21.0 necessitate this performance regression when using Webpack v4, or is there a way to fix this?

Reproduction

n/a

Node.js package manager

npm

Environment

npmPackages:
  webpack: 4.x
  esbuild-loader: 2.21.0

Can you contribute a fix?

  • I’m interested in opening a pull request for this issue.
@Chevelleboyer Chevelleboyer added bug Something isn't working pending triage labels Feb 9, 2023
@privatenumber
Copy link
Owner

I can't help you with how little information you've provided.

Can you provide a minimal reproduction so I can debug?

@Chevelleboyer
Copy link
Contributor Author

You mean n/a wasn't enough? 😂

While trying to reproduce with a trivial project, I found that we actually had a patch for esbuild-loader 2.20.0

Our patch was disabling the calls to asset.source.map() and asset.source.sourceAndMap() unless it was a sourcemap build. (We generate sourcemaps in a separate build)

Removing our patch makes v2.20.0 and v2.21.0 perform the same 😃

Closing this now, sorry for any troubles!!

@Chevelleboyer Chevelleboyer closed this as not planned Won't fix, can't repro, duplicate, stale Feb 10, 2023
@privatenumber
Copy link
Owner

Are you saying disabling those calls makes large performance improvements even with devtools: false in the Webpack config?

If so, I'm very open to bringing those changes into the project. Would you be willing to open a PR?

@Chevelleboyer
Copy link
Contributor Author

Yes that's correct, even with devtools: false it seems like asset.source.sourceAndMap() is still being called. Our patch just calls asset.source.source() instead of asset.source.sourceAndMap() if sourcemaps aren't enabled.

And yes I'm happy to open a PR!😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending triage
Projects
None yet
Development

No branches or pull requests

2 participants