Closed zerkalica closed 6 years ago
I don't think I can take credit for the whole of rollup here. :) If you want to measure effect of rpt2 on performance, pre-compile all ts files and compare rollup with rpt2 vs rollup using pre-compiled js files.
I know it probably has worse performance than awesome-typescript-loader on webpack side and there is room for cache loading optimizations, but ultimately plugin is driven by rollup.
My own project, about 20K sloc, cold builds in 18-20s and rebuilds in 5-6s.
Using full verbosity in watch mode will kill things for sure, although there should be no memory leaks, I thought I fixed that sometime ago.
But why parcel faster without any cache and optimizations on simplest TypeScriptAsset?
Check this out for some of the reasons: https://github.com/parcel-bundler/parcel/issues/392
Looks like it does less work than rollup and it does it faster too (because it processes the files in parallel)
Would it be possible to add a 'fast mode' where TypeScript error checking is suppressed? I recently used rollup-typescript, another fork, which ran a lot faster and also seems to be using the TypeScript 2 compiler. It's broken in other ways, so I guess this is currently the most promising-looking project in this space, but during debugging I really prefer fast build types to error checking (my editor already shows me the errors).
(If you think this'd make sense and can point me in the right direction, I'll gladly work on a PR.)
@marijnh yep, already there, set check: false
in plugin options. Let me know if it improves things, could be slightly faster than original plugin on rebuilds.
Hm, I have that set, but it doesn't seem to make much difference (build time is about the same).
Okay, hold on, it's still checking (I can trigger errors). I'm using the plugin like below, which seems like it should set the option.
import typescript from "rollup-plugin-typescript2";
export default {
input: "./view/test/test.ts",
output: { ... },
plugins: [
typescript({
check: false,
tsconfigOverride: {...}
})
]
}
Oh, it's related to rollup -w
-- I do see the speedup in non-watch mode. See #82
Demo repository: https://github.com/zerkalica/rpt2-bug package.json
rollup.config.js
src/index.tsx
Build time: 3.6s, Warm rebuild time: 2.1s
Build time: 5.4s, Warm rebuild time: 0.6s
In my project about 2K SLOC, rebuild time in watch mode about 5-6 s in rpt2. Parcel - about 930ms.
If enable
verbosity: 5
- process crashed with out of memory or do inifite writes to console after changing file in watch mode.