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

Update the fuse-box benchmark #26

Closed
nchanged opened this issue Feb 19, 2020 · 7 comments
Closed

Update the fuse-box benchmark #26

nchanged opened this issue Feb 19, 2020 · 7 comments

Comments

@nchanged
Copy link

Hi,
First of all, I would like to say I appreciate your effect and the project. Good Job! I love open source myself and love seeing people do some awesome stuff! Keep up!

That said, I would like to suggest to set up a proper benching for FuseBox with the latest version. The @next version is outdated since it has undergone a full a refactor and I am publishing it with the alpha tag

FuseBox now has its own custom compiler that managed to pass your bench in 6 seconds. And it will be even faster when we publish it.

If possible, could you include development builds?
Production versions are always slower for a reason. After all, development experience is what matters most.

fuse-box@4.0.0-alpha.307

Development run

FUSEBOX_RUN += require('fuse-box').fusebox({
FUSEBOX_RUN +=   target: 'browser',
FUSEBOX_RUN +=   hmr: false,
FUSEBOX_RUN +=   devServer : false,
FUSEBOX_RUN +=   watcher : false,
FUSEBOX_RUN +=   logging: {level : 'disabled'},
FUSEBOX_RUN +=   entry: './fusebox-entry.js',
FUSEBOX_RUN += }).runDev({ bundles : {app : 'app.js'}});

Results:

real 6.01
user 7.22
sys 0.57

Prod run

FUSEBOX_RUN += require('fuse-box').fusebox({
FUSEBOX_RUN +=   target: 'browser',
FUSEBOX_RUN +=   logging: {level : 'disabled'},
FUSEBOX_RUN +=   entry: './fusebox-entry.js',
FUSEBOX_RUN += }).runProd({ bundles : {app : 'app.js'}});

results:

real 30.89
user 44.42

I'd really appreciate the above-mentioned fixes to the benches and updated stats.

Thanks ;-)

@evanw
Copy link
Owner

evanw commented Feb 22, 2020

My benchmark is only for full production builds. One of my main reasons for creating esbuild in the first place is to demonstrate that production builds don't have to be slow and to encourage existing bundlers to have faster production builds.

I'm not worried about the speed of development builds. It's easy to make development builds fast because you don't need to transform the source code much. In some cases you don't need a bundler during development at all since browsers now support ES6 modules natively. This is the case in my benchmark, for example.

It's great that you're working on a faster compiler! That's really exciting. However, I tried out fuse-box@4.0.0-alpha.307 using the production settings you described and the output is 9.8mb. This is much bigger than the previous size using fuse-box@next (6.5mb) which itself is much bigger than the output of all other bundlers (~5.9mb). It looks like this is because fuse-box@4.0.0-alpha.307 does not minify the output beyond removing whitespace. I don't consider this a production build on its own because you would need to run it through a minifier before using it in production.

Also the generated output is not valid JavaScript, so this doesn't count as a successful build for my benchmark:

bench/three/fusebox/dist/app.js:35:2761: error: Expected ";" but found "Object"
...ject.assign(exports, __fusereq(4))Object.assign(exports, __fusereq(50))var...
                                     ~~~~~~

I'm happy to update the version of FuseBox used in my benchmark when you have a new version that meets the requirements of the benchmark.

@evanw evanw changed the title incorrect fuse-box benchmark Update the fuse-box benchmark Feb 22, 2020
@nchanged
Copy link
Author

@evanw fair enough. I will make sure it runs and minifies it, then we will update the bench. Thanks.

@evanw evanw closed this as completed in bec3d2a May 26, 2020
@evanw
Copy link
Owner

evanw commented May 26, 2020

I just updated the versions of all packages used in the benchmark and it looks like the latest version of fuse-box@next pretty much passes my tests for a valid benchmark entry. So I included it and I'm considering this issue fixed. The only caveat I found as far as correctness was that the line numbers for the source map generated by fuse-box seem to be off by one. And with the update, fuse-box is no longer the slowest bundler in my benchmark! It's great to see these performance improvements.

@nchanged
Copy link
Author

Thanks! I will check what's wrong. Terser spoils the picture, it takes the longest time.

But in the long run, I am myself considering doing some magic with GO. It would be really cool to use your minifier! Do you have any plans on splitting it into packages ? Like parser, printer, minifier ?

@evanw
Copy link
Owner

evanw commented May 26, 2020

Do you have any plans on splitting it into packages ? Like parser, printer, minifier ?

I don't have any plans to do that at the moment. However, I do have a JavaScript API for transforming code using esbuild. It can be used to minify code if you pass minify: true.

@nchanged
Copy link
Author

Cool, thanks for that! But I was mainly interested in the GO part. Node.Js Is a Christmas toy compared to GO.

@jpike88
Copy link

jpike88 commented Aug 6, 2021

@evanw is a basic, minimal go api ever going to be possible?

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

No branches or pull requests

3 participants