question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cache makes bundling slower instead of faster in recent versions (starting with 0.19.0)?

See original GitHub issue

It seems that the build cache of this plugin makes performance worse instead of improving it, starting with package version 0.19.0.

I noticed this when upgrading the build scripts at my company to use the latest package versions of everything; including an update of ezolenko/rollup-plugin-typescript2 from version 0.12.x to 0.19.2. This increased bundling times by a factor of approx. 2x (from approx. 3 sec. to 6-8 sec per bundling).

I thought I’d share my brief investigations with you. I set up a small benchmark (see stakx/rollup-plugin-typescript2-benchmark) to demonstrate this. Admittedly it’s not a super-accurate benchmark, but I think it still shows that setting the clean option to false appears to affect bundling time negatively (instead of improving it, as one would expect from having a cache ready for use).

I’ll reproduce the measurements I took below; see the linked repo for the actual benchmark code.

Package version run clean: true [ms] clean: false [ms] clean: false ÷ clean: true [%]
0.15.0 1 836 670
2 840 638
3 884 574
avg. 853 627 74 %
0.16.0 1 841 576
2 816 607
3 834 581
avg. 830 588 71 %
0.17.0 1 861 582
2 839 603
3 835 594
avg. 845 593 70 %
0.18.0 1 1147 998
2 1192 882
3 1207 882
avg. 1182 921 78 %
0.18.1 1 815 617
2 837 590
3 823 590
avg. 825 599 73 %
0.19.0 1 828 896
2 803 897
3 836 901
avg. 822 898 109 %
0.19.1 1 850 913
2 825 888
3 799 881
avg. 825 894 108 %
0.19.2 1 1020* 888
2 816 902
3 826 890
avg. 887 893 101 %

Note how having a cache populated (clean: false) led to quicker bundling times (approx. 70 % of clean: false) up until 0.18.1. Starting with 0.19.0, clean: false would actually increase bundling times by approx. 10 %. (Note also the outlier marked with a *, which makes 0.19.2 appear to perform better than it really does.)

This cache slowdown is quite a pity especially since clean: false is currently the default.

(P.S.: I’d like to make clear that I’m not saying clean: false will by itself be sufficient to worsen performance of this plugin. I simply noticed this and found it curious, it might be worth looking into more closely.)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
ezolenkocommented, Feb 25, 2019

In 0.19.3 on npm now

1reaction
stakxcommented, Feb 25, 2019

Awesome! Thank you for taking care of this so promptly. Great to see a project being maintained so well. 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

When Network is Faster than Cache - Simon Hearne
We assume that browser caches are near-instantaneous, but data shows that retrieving an object from cache can take hundreds of milliseconds!
Read more >
Gitlab CI suite optimizations, and how I decreased the carbon ...
A case could be made that linting should only be run for the latest version, and “just work” for the rest. However, rubocop...
Read more >
Asset Versioning & Cache Busting > Webpack Encore
There is one last thing I want to talk about, and it's one of my favorite features in Encore. Here's the question: how...
Read more >
@volar/typescript-faster | Yarn - Package Manager
TypeScript Language Service Completion API is slow when calculate auto-import. This package make it faster by ported tsserver auto-import caching logic.
Read more >
Slow initial webpack build - Stack Overflow
Babel caching; Webpack module analyzer; excluding node_modules. Here is my webpack.config.js file: let path = ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found