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
Benchmark against SWC / pax #2
Comments
@dy Currently, swc does not have a feature to bundle files. |
So I'm not at all familiar with SWC and Pax but it seems like these tools don't do the same thing as the other tools that I'm benchmarking. To be relevant for my benchmark, the build tool must be able to do a full production build. SWC's minification seems to be whitespace-only as far as I can tell? Pax appears to be only for development and the output is too verbose for a production build. The smallest size I could get for SWC and Pax with minification enabled is 15mb. This is far bigger than the other tools in my benchmark which all generate bundles around 5.8mb. When it worked, the build time for running SWC followed by Pax was around 2.5 seconds, which seems promising. SWC logs 2,530 errors to the console during the build process though so it's possible that a big part of the build time is being spent doing console I/O, and the build time would be much better if it didn't log so many errors. SWC also appears to be somewhat unstable. When I run it on my benchmark, around 50% of the time it panics and crashes instead of completing successfully. The specific panic is I'm going to close this issue because I believe SWC and Pax are not yet appropriate tools for production builds, and so aren't relevant for my benchmark. |
@evanw Can you share the code which crashed swc? |
Of course:
The errors all looked like this:
|
@evanw Thanks! I'll look at it. |
I failed to reproduce the crash.
Can you share more information about your testing? Like how much time you invoked, or operating system you are using. |
There's a for loop in the Lines 101 to 102 in 697e0f5
I'm guessing your shell or version of make is different than mine and it's not interpreting the for loop the same way? I'm using bash 3.2.57(1)-release and make 3.81 on macOS 10.14.6. What about you? |
My os is ubuntu and I'm using bash (with zsh). I'll try it on my mac. |
I successfully reproduced it, but it goes away when I invoked with |
Cool, glad I could help! It's great that it wasn't hard to reproduce. And thanks for the info about zsh. I'll modify the for loop so it works in both bash and zsh. |
I fixed the random panic, and ran it. (Note: swc is a compiler, and it transforms code instead of bundling it)
5.446 seconds / 6091 file = 0.00089410605 seconds per file = 0.894ms / file. |
Is that with es3 compilation now? |
I targeted es5. |
By the way I'm currently tracking adding spack to my benchmarks with #762. I recently posted an update about this in case anyone on this thread is interested: #762 (comment). Follow that thread for further updates. |
There are bundlers in Rust: pax and swc.
Would that be interesting to compare their performance too?
The text was updated successfully, but these errors were encountered: