Skip to content
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

Do you really need rpt2? #189

Closed
mikob opened this issue Nov 2, 2019 · 5 comments
Closed

Do you really need rpt2? #189

mikob opened this issue Nov 2, 2019 · 5 comments
Labels
kind: discussion Discussion on changes to make kind: optimization Performance, space, size, etc improvement kind: question This is a usage or similar question problem: stale Issue has not been responded to in some time solution: Rollup behavior This is Rollup's behavior and not specific to this plugin

Comments

@mikob
Copy link

mikob commented Nov 2, 2019

What happens and why it is wrong

Related to #79 and #148

Just a quick PSA in case it will help people out. I was using this plugin because it was convenient but building would take 2gb of memory and a long time. I narrowed down the issue to this plugin. Now I'm simply using tsc then plugging in the js input to rollup instead and my build time is down about 5x and memory down about 100x.

I'm not knocking on the hard work @ezolenko (thanks for the plugin) has done in this project, and I'm sure it's still useful to those with smaller projects, but if you're like me and see performance issues, think if you really need this plugin because the perf costs are high.

Just my 2 cents...

Versions

  • typescript: 3.6.4
  • rollup: 1.26.3
  • rollup-plugin-typescript2: 0.25.1
@ezolenko ezolenko added the kind: question This is a usage or similar question label Nov 5, 2019
@ezolenko
Copy link
Owner

ezolenko commented Nov 5, 2019

Yep, convenience has a price. :) If anybody has an idea of how to speed it up, make a PR :)

@adrianmcli
Copy link

@mikob

Now I'm simply using tsc then plugging in the js input to rollup instead and my build time is down about 5x and memory down about 100x.

Thanks for the data point, as someone still trying to decided if I want to start my next TS library with Rollup, can you give us a summary of how you did this?

@sntran
Copy link

sntran commented Jun 22, 2020

@mikob

Now I'm simply using tsc then plugging in the js input to rollup instead and my build time is down about 5x and memory down about 100x.

I am also interested in your solution. The entry point usually imports a bunch of other modules, so we use rollup to bundle them all into a single file. tsc only supports single outfile for "AMD" and "System" module format.

@mikob
Copy link
Author

mikob commented Jun 24, 2020

@adrianmcli @sntran I'm using the typescript compiler API and the rollup API in a script. Basically, like this:

watchTs(); const watcher = rollup.watch(rollupConfig);

watchTs does a lot of boilerplate ts things (they don't make their API easy). You can start by looking at ts.createWatchCompilerHost

@agilgur5 agilgur5 added problem: stale Issue has not been responded to in some time kind: optimization Performance, space, size, etc improvement kind: discussion Discussion on changes to make solution: Rollup behavior This is Rollup's behavior and not specific to this plugin and removed help wanted labels Sep 4, 2022
@agilgur5
Copy link
Collaborator

agilgur5 commented Sep 5, 2022

Hi folks, just doing some housekeeping in the issues. I'm going to close this one out as it's gone quite stale (no comments in 2+ years) and only has one upvote.

This issue also does not have a specific course of action nor much specific performance tunings -- please see #148 for some discussion on various tunings / configurations / benchmarks. I've also described some Rollup + rpt2 nuances in #148 (comment) there.
There may be other optimizations to be had in other issues with specific recommendations such as #113, but this one is too generic to really be actionable.

That being said, please feel free to continue recommending specific optimizations and the performance characteristics of different configurations here and in #148, as those can be helpful / useful, especially to other users!

@agilgur5 agilgur5 closed this as completed Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: discussion Discussion on changes to make kind: optimization Performance, space, size, etc improvement kind: question This is a usage or similar question problem: stale Issue has not been responded to in some time solution: Rollup behavior This is Rollup's behavior and not specific to this plugin
Projects
None yet
Development

No branches or pull requests

5 participants