-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Parser time and memory use grows exponentially on sequence of [[[[ #10438
Copy link
Copy link
Closed
Labels
performanceWork to make nushell quicker and use less resourcesWork to make nushell quicker and use less resources
Milestone
Description
Describe the bug
When you type a sequence of open square braces, the parser branches exponentially and uses exponentially more memory for each extra branch.
How to reproduce
- Type
[[[[[[[[[[[[[[[[[[[[[[[[in nushell - Watch as every keystroke gets slower and the memory use of
nuwill soon be in the gigabytes
Expected behavior
At least be polynomial in parsing time
Screenshots
No response
Configuration
version | transpose key value | to md --pretty
| key | value |
|---|---|
| version | 0.83.1 |
| branch | |
| commit_hash | |
| build_os | macos-x86_64 |
| build_target | x86_64-apple-darwin |
| rust_version | rustc 1.71.1 (eb26296b5 2023-08-03) (built from a source tarball) |
| cargo_version | cargo 1.71.1 |
| build_time | 1980-01-01 00:00:00 +00:00 |
| build_rust_channel | release |
| allocator | standard |
| features | default, sqlite, trash, which, zip |
| installed_plugins | hist, plot, xyplot |
Additional context
Found using the fuzzer. Original comment here #10376 (comment)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
performanceWork to make nushell quicker and use less resourcesWork to make nushell quicker and use less resources