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.
Description
Similar to #8949, Nushell reuses parsed module if the same file is being parsed again.
Benchmarks
(results rounded to milliseconds, the mean values from
bench
vary within +-1 ms)Baseline
Overhead of calling
nu
on empty file:Benchmark 1
Repeated calls to
use
Old vs. new running times:
Benchmark 2
Real project which reuses a
utils
module in several files (https://github.com/kubouch/nuun, commit 5bf92d799d1561ddebd329c3e8106d575f4c8fa0)User-Facing Changes
Speedup if parsing the same file more than once as a module.
Tests + Formatting
After Submitting