nushell/crates/nu-command/src
Stefan Holderbach ee648ecb7d
Refactor transpose and improve perf (#11013)
# Description

Generally elide a bunch of unnecessary clones. Both globally stopping to
clone the whole input data in a bunch of places where we need to read it
but also some minor places where we currently cloned.

As part of that, we can make the overwriting with `keep-all` and
`keep-last` inplace so the items don't need to be removed and repushed
to the record. 

# Benchmarking

```nu
timeit { scope commands | transpose -r }
```

Before ~24 ms now just ~5 ms

# User-Facing Changes
This can change the order of apperance in the transposed record with
`--keep-last`/`--keep-all`. Now the
order is determined by the first appearance and not by the last
appearance in the ingoing columns.
This mirrors the behavior when not passed `keep-all` or `keep-last`.

# Tests + Formatting
Sadly the `transpose` command is so far undertested for more complex
operations.
2023-11-09 22:41:38 +01:00
..
bytes Convert ShellError::UnsupportedInput to named fields (#10971) 2023-11-07 23:25:32 +01:00
charting Use Vec for Closure captures (#10940) 2023-11-08 00:43:28 +01:00
conversions Improve case insensitivity consistency (#10884) 2023-11-08 23:58:54 +01:00
database Use Record's public API in a bunch of places (#10927) 2023-11-08 14:24:00 +01:00
date Improve case insensitivity consistency (#10884) 2023-11-08 23:58:54 +01:00
debug Use Record::get instead of Value functions (#10925) 2023-11-08 21:47:37 +01:00
env Use Vec for Closure captures (#10940) 2023-11-08 00:43:28 +01:00
experimental Add functions for each Value case (#9736) 2023-07-21 08:20:33 -05:00
filesystem Add umkdir command (#10785) 2023-10-30 07:59:48 -05:00
filters Refactor transpose and improve perf (#11013) 2023-11-09 22:41:38 +01:00
formats Use record API in more parts of nu-protocol (#10928) 2023-11-08 23:03:08 +01:00
generators Improve case insensitivity consistency (#10884) 2023-11-08 23:58:54 +01:00
hash Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
help Improve case insensitivity consistency (#10884) 2023-11-08 23:58:54 +01:00
math Convert ShellError::UnsupportedInput to named fields (#10971) 2023-11-07 23:25:32 +01:00
misc Add long options for misc and network (#10753) 2023-10-19 18:16:44 +02:00
network Use Record's public API in a bunch of places (#10927) 2023-11-08 14:24:00 +01:00
path Convert ShellError::UnsupportedInput to named fields (#10971) 2023-11-07 23:25:32 +01:00
platform Improve case insensitivity consistency (#10884) 2023-11-08 23:58:54 +01:00
random Add long options for platform and random (#10776) 2023-10-19 22:04:33 +02:00
removed Rename misused "deprecation" to removal (#10000) 2023-08-15 07:17:31 +12:00
shells Fix usage for the exit command. (#9450) 2023-06-16 10:09:02 +02:00
strings Improve case insensitivity consistency (#10884) 2023-11-08 23:58:54 +01:00
system Improve case insensitivity consistency (#10884) 2023-11-08 23:58:54 +01:00
viewers Use record API in more parts of nu-protocol (#10928) 2023-11-08 23:03:08 +01:00
default_context.rs Add exec command for Windows (#11001) 2023-11-08 14:50:25 -06:00
example_test.rs feat: Add unfold command (#10489) 2023-09-30 09:08:06 -05:00
lib.rs Move eval_hook to nu-cmd-base (#10146) 2023-08-29 23:46:50 +02:00
progress_bar.rs cp progress bar implementation (#8012) 2023-02-22 11:57:38 -08:00
sort_utils.rs Improve case insensitivity consistency (#10884) 2023-11-08 23:58:54 +01:00