nushell/crates/nu-command
raccmonteiro 75cb3fcc5f
uniq and uniq-by optimization (#7477) (#7534)
# Description

Refactored the quadratic complexity on `uniq` to use a HashMap, as key I
converted the Value to string.
I tried to use the HashableValue, but it looks it is not very developed
yet and it was getting more complex and difficult.

This improves performance on large data sets.

Fixes https://github.com/nushell/nushell/issues/7477


# Tests + Formatting
```
> let data = fetch "https://home.treasury.gov/system/files/276/yield-curve-rates-1990-2021.csv"
> $data | uniq
```

it keeps original attribute order in Records:
```
> [ {b:2, a:1} {a:1, b:2} ] | uniq 
╭───┬───┬───╮
│ # │ b │ a │
├───┼───┼───┤
│ 0 │ 2 │ 1 │
╰───┴───┴───╯
```
2023-01-04 11:35:49 -08:00
..
assets refactor html module (#5246) 2022-04-20 08:50:14 -05:00
proptest-regressions/format_conversions add tests, deal with pipes, newlines, tabs for to nuon (#6391) 2022-09-01 14:08:19 +02:00
src uniq and uniq-by optimization (#7477) (#7534) 2023-01-04 11:35:49 -08:00
tests Make stream info visible to users in describe (#7589) 2023-01-03 21:08:05 -08:00
build.rs Fix panic when building without git (#6289) 2022-08-10 10:31:12 -05:00
Cargo.toml let start open anything and everything (#7580) 2023-01-03 10:47:37 -08:00
LICENSE Include license text in all crates (#5094) 2022-04-08 10:47:13 +02:00