4 ms·
I bet nearly 100% of web apps would benefit from increased performance in npm install, typescript and webpack compilation
by jdxcode 4y ago
I bet nearly 100% of web apps would benefit from increased performance in npm install, typescript and webpack compilation
- cassepipe 4y agoFor npm install it seems it is a solved problem: just use pnpm as a drop in replacement. It's such a basic idea : instead of reinstalling dependancies in each repo, just hard link them from a common store and there you go, you just reuse them. Simple yet brilliant.
- jdxcode 4y agoThat doesn't help CI performance. I bet `bun install` is way faster than `pnpm install` on a cold or hot cache (though I haven't tested myself). I think it does similar things to pnpm under the hood to improve local development speed as well. EDIT: just tested on the eslint codebase: cold (nothing installed, no cache): bun: 1.53s, pnpm: 8.25s, npm: 25s hot (already installed, noop): bun: 218ms, pnpm: 1300ms, npm: 1230ms
- pier25 4y agoIf performance is critical IMO it would make a lot more sense to switch to Rust or Go than Bun. Instead of getting a 2-3x improvement (best case scenario) you will get more like 10-20x. Webpack 5 is probably the last version. Not my words, but from its main author. Vite is the new de facto bundler which uses EsBuild (written in Go).
- jdxcode 4y agoI don't think you understand the point of bun. It's not to make npm/webpack/typescript faster at running JS code, it's to replace those tools entirely. So in essence, it's doing the same thing that esbuild is doing, just across all of the major tasks people currently do with node. What's different about bun vs esbuild is that it's one tool you can use for everything you do in JS projects. I've swapped much of my usage of npm over to bun. I still work on projects where nobody else is using bun, but I can run `bun install` instead of `npm install` and `bun run` instead of `npm run` and these run probably 100x faster.
- pier25 4y ago> So in essence, it's doing the same thing that esbuild is doing, just across all of the major tasks people currently do with node. Except that Bun is not going to be able to do what esbuild is doing because Go and other languages are in another league regarding perf.
- pfg_ 4y agobun is already faster than esbuild? i don't understand this comment. the bun transpiler is basically a direct port of esbuild to zig. esbuild is a javascript transpiler. it transpiles typescript into javascript that v8 or another js engine can run. it's written in go which is the main reason it's faster than pure js transpilers like babel. were you thinking that esbuild is for go code? i'm confused bun is a combined javascript transpiler & runtime & test runner & package manager. it improves performance of many things: - startup time including transpiling code and resolving modules and initializing the javascript vm - installing packages - running tests it can also improve runtime performance (it is faster at basically every bit of the node api it covers & it has its own versions of some things like http servers that can have better performance than the node APIs) switching your project to rust would improve runtime performance, but would make it slower to run tests & compile the project & use an ide language server & … i haven't used go but i've heard it's fast to compile & has better runtime performance than js
- jdxcode 4y agoHow on earth have you come to that conclusion? Bun is written in Zig—which is a low-level C replacement.
- pier25 4y agoSo? V8 is written in C++ and yet the JS performance is nowhere near as close to that.
- 3np 4y ago> Webpack 5 is probably the last version. Not my words, but from its main author. Got a reference or specifics on that one?
- pier25 4y agoCheck the section where he talks about Webpack 5 years from now. https://www.youtube.com/watch?v=8oQG5x20Uj4 https://www.youtube.com/watch?v=8oQG5x20Uj4
- 3np 4y agoJust watched it - I don't see him saying anything about 5 being the last major version. In the Q&A he answers the question "should I use webpack for a new React project" with an "I'd say a biased 'yes' but it depends". He weighs the pros and cons of fixing vs rewrite, identifying that there are fundamental issues which will never be addressed in webpack. FWIW the presenter is employed at Vercel on building Turbopack, which is presented as the "webpack successor" - so I'm quite sure either way he wouldn't agree with your take on esbuild being the future ;)
- pier25 4y agoThere's a big slide that says: "I don't know" about using Webpack for new projects. Coming from its main author I'd say that very closely represents to what I wrote before. The Vite part I added it myself. Sorry if that wasn't clear. Regarding TurboPack, we'll see. So far it's not very popular outside of Next. SvelteKit uses Vite, even though Vercel is paying for two people full time working on it.
- 3np 4y agoThat's an "I don't know if Webpack will be a popular choice for greenfield projects in 5 years" (which is stating the obvious and should be equally true for Vite or turbopack at this point and very far from what you wrote). Culture difference behind the misinterpretation maybe? The lack of self-inflation, exaggerated confidence and exceptionalism we might expect from Americanized presenters shouldn't be taken for insecurity or doubt ;) I'd listen to what they say at face-value rather than trying to read the lines applying the wrong lens. > Regarding TurboPack, we'll see. So far it's not very popular outside of Next. It's very early still, in alpha, and isn't recommended for production use outside of Next, where most of the focus on integration and tooling has been so far AFAIK.