News for hackers. Stuff that matters.
Re:Vercel announces Turbopack, the successor to Webpack by hmillison on Tuesday October 25, 2022 @01:49PM (#33333907)
according to the article, Turbopack is 10-20x faster than Vite. I wonder how they were able to edge it out so significantly!
Re:Vercel announces Turbopack, the successor to Webpack by brundolf on Tuesday October 25, 2022 @01:53PM (#33333964)
I would guess they're factoring this in:

> Turbopack is built on Turbo: an open-source, incremental memoization framework for Rust. Turbo can cache the result of any function in the program. When the program is run again, functions won't re-run unless their inputs have changed. This granular architecture enables your program to skip large amounts of work, at the level of the function.

Which would make that multiple an extremely rough estimate, highly-dependent on the situation. But it's still an exciting development

Re:Vercel announces Turbopack, the successor to Webpack by IshKebab on Tuesday October 25, 2022 @03:00PM (#33334758)
I wonder how they make that robust, given that Rust isn't pure and there's no way to force a function to be pure either.
Re:Vercel announces Turbopack, the successor to Webpack by brundolf on Tuesday October 25, 2022 @03:24PM (#33335002)
It's not very hard to stick to a pure-ish style even in languages that don't statically enforce it; JavaScript's MobX framework has the same constraint, as do React functions, and computed properties in Vue, etc. You don't really get any static help with functional purity in those cases, but thousands of programmers do it successfully every day

And while Rust doesn't strictly enforce purity, it does make it a lot easier to stick to in practice with its explicit `mut` keyword for local variables, references, and function arguments (including for the `self` argument on methods). There are various ways like RefCell to work around this if you're really trying to, but you have to go out of your way.

Re:Vercel announces Turbopack, the successor to Webpack by atfzl on Tuesday October 25, 2022 @02:09PM (#33334157)
Vite uses esbuild for transpiling and rollup for bundling. esbuild (written in go) is already pretty fast for transpiling but there might be a lot of possibilities to optimize in rollup as rollup is written in JavaScript.
Re:Vercel announces Turbopack, the successor to Webpack by FractalHQ on Tuesday October 25, 2022 @05:36PM (#33336500)
Coincidentally, the primary maintainer of Rollup mentioned plans for a rust rewrite in his recent talk at Vite Conf.
Re:Vercel announces Turbopack, the successor to Webpack by hardwaregeek on Tuesday October 25, 2022 @02:20PM (#33334277)
Incremental compilation plus not having each dependency be its own network request (I work on Turbo, but not Turbopack).
Re:Vercel announces Turbopack, the successor to Webpack by fabian2k on Tuesday October 25, 2022 @01:54PM (#33333985)
The answer seems to be caching (https://turbo.build/pack/docs/core-concepts), lots and lots of caching. Which enables it to reuse a lot of already computed stuff for incremental rebuilds.
Re:Vercel announces Turbopack, the successor to Webpack by lelandfe on Tuesday October 25, 2022 @03:41PM (#33335205)
Which makes me wonder if the speed comparison graphics are solely about repeat builds.
Re:Vercel announces Turbopack, the successor to Webpack by minimaxir on Tuesday October 25, 2022 @01:50PM (#33333928)
Rust is a hell of a drug.
Re:Vercel announces Turbopack, the successor to Webpack by maxfurman on Tuesday October 25, 2022 @01:52PM (#33333944)
My guess is some combination of dropping support for older browsers, supporting fewer features, and optimizing for the common case at the expense of edge cases. In a few releases, once all those are added back in, it will be no faster than Vite.