Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
v8-compile-cache doesn't play nice with ESM, that's why 2 years ago we created a component @teambit/toolbox.performance.v8-cache to uninstall it on demand when ESM is needed.
See #5071 for more info.
However, from some benchmarks I made recently, it turns out that it slows down the typescript-compilation on build (478 components, it takes 3:35 with the cache, 3:05 without the cache).
Another benchmark I made is simply loading bit with no args. Here is the average loading time on M1 Mac:
with toolbox.performance.v8-cache: 0.995s
no cache: 0.84s
v8-cache-directly: 0.75s
On Windows, without the cache and with toolbox.performance.v8-cache it took the same time.
In the near feature, all main envs will be using ESM so this v8 cache won't be relevant anyway. Also, once we are able to bundle bit to one file, this bundle won't include the v8-cache. Therefore, it makes more sense to just remove it instead of fighting it to make it somehow work for non-ESM.