Skip to content

Much slower than vanilla Parcel #31

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

Open
robcrocombe opened this issue Mar 9, 2018 · 4 comments
Open

Much slower than vanilla Parcel #31

robcrocombe opened this issue Mar 9, 2018 · 4 comments

Comments

@robcrocombe
Copy link

robcrocombe commented Mar 9, 2018

I'm testing this and Parcel on a large Angular 1.6 TypeScript project - bundled to about 8MB uncompressed, 4.4MB compressed.

I have found that the warm startup (with a .cache folder) is about the same speed, ~6 seconds. Cold startup (without .cache) is ~35 seconds with vanilla Parcel, but incredibly slow with the TS plugin, ~320 seconds - 5 minutes!

Watching files is also slower, about 1-5 seconds with the plugin depending on the amount changed. It's usually 0.3-1.5 seconds with vanilla Parcel.

Is there anything that can be done to improve performance? Thanks

@fathyb
Copy link
Owner

fathyb commented Mar 9, 2018

Thanks for the report. Is it still slow if you set transpileOnly to true? (see Configuration)

Also does it only happens in build mode or in watch mode too?
Nevermind I misread, it happens in both.

@robcrocombe
Copy link
Author

With transpileOnly as true, its about the same as vanilla Parcel, only slightly slower when watching files it seems. But I also see no benefit to that mode?

@mohsen1
Copy link

mohsen1 commented May 27, 2018

Maybe investigate spawning type checker into a separate thread to avoid holding critical path for type checking

@fathyb
Copy link
Owner

fathyb commented May 27, 2018

@mohsen1 this is already the case :
https://github.com/fathyb/parcel-plugin-typescript/blob/develop/src/backend/worker/index.ts

I'm using the plugin on pretty big TypeScript projects at work (~400kLOC) and I get better performance than awesome-typescript-loader and ts-loader on CircleCI and our in-house Jenkins (never compared to vanilla Parcel given that type-checking is the slowest step on most ts projects).

This may be due to something else in your setup, if someone could provide a reproduction it would help me find out what's going on.

Keep in mind that TypeScript is almost (if not already) statically Turing-complete, if you use a lot of generics and infer it may slow down your build.

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