nushell/crates/nu-command/src
Ian Manske c19944f291
Refactor window (#13401)
# Description
Following from #13377, this PR refactors the related `window` command.
In the case where `window` should behave exactly like `chunks`, it now
reuses the same code that `chunks` does. Otherwise, the other cases have
been rewritten and have resulted in a performance increase:

| window size | stride | old time (ms) | new time (ms) |
| -----------:| ------:| -------------:| -------------:|
| 20          | 1      | 757           | 722           |
| 2           | 1      | 364           | 333           |
| 1           | 1      | 343           | 293           |
| 20          | 20     | 90            | 63            |
| 2           | 2      | 215           | 175           |
| 20          | 30     | 74            | 60            |
| 2           | 4      | 141           | 110           |


# User-Facing Changes
`window` will now error if the window size or stride is 0, which is
technically a breaking change.
2024-07-19 04:16:09 +00:00
..
bytes Internal representation (IR) compiler and evaluator (#13330) 2024-07-10 17:33:59 -07:00
charting Add derive macros for FromValue and IntoValue to ease the use of Values in Rust code (#13031) 2024-06-17 16:05:11 -07:00
conversions Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
database Add and use new Signals struct (#13314) 2024-07-07 22:29:01 +00:00
date Add and use new Signals struct (#13314) 2024-07-07 22:29:01 +00:00
debug Add IR support to the debugger (#13345) 2024-07-13 01:58:21 -07:00
env Internal representation (IR) compiler and evaluator (#13330) 2024-07-10 17:33:59 -07:00
experimental Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
filesystem Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
filters Refactor window (#13401) 2024-07-19 04:16:09 +00:00
formats Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
generators Internal representation (IR) compiler and evaluator (#13330) 2024-07-10 17:33:59 -07:00
hash Add and use new Signals struct (#13314) 2024-07-07 22:29:01 +00:00
help Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
math Internal representation (IR) compiler and evaluator (#13330) 2024-07-10 17:33:59 -07:00
misc Revert "Span ID Refactor (Step 2): Make Call SpanId-friendly (#13268)" (#13292) 2024-07-04 00:02:13 +03:00
network Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
path Path migration 1 (#13309) 2024-07-09 17:25:23 +08:00
platform Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
random Add and use new Signals struct (#13314) 2024-07-07 22:29:01 +00:00
removed Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
shells Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
stor Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
strings tweak parse usage and examples to be more clear (#13363) 2024-07-12 09:48:27 -05:00
system Switch from dirs_next 2.0 to dirs 5.0 (#13384) 2024-07-16 07:16:26 -05:00
viewers Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
default_context.rs Deprecate group in favor of chunks (#13377) 2024-07-16 03:49:00 +00:00
example_test.rs Overhaul $in expressions (#13357) 2024-07-17 16:02:42 -05:00
lib.rs Add top-level crate documentation/READMEs (#12907) 2024-07-14 10:10:41 +02:00
progress_bar.rs Replace ExternalStream with new ByteStream type (#12774) 2024-05-16 07:11:18 -07:00
sort_utils.rs Add derive macros for FromValue and IntoValue to ease the use of Values in Rust code (#13031) 2024-06-17 16:05:11 -07:00