nushell/crates/nu-command/src
Devyn Cairns 28e33587d9
msgpackz: increase default compression level (#13035)
# Description
Increase default compression level for brotli on msgpackz to 3. This has
the best compression time generally. Level 0 and 1 give weird results
and sometimes cause extremely inflated outputs rather than being
compressed. So far this hasn't really been a problem for the plugin
registry file, but has been for other data.

The `$example` is the web-app example from https://json.org/example.html

Benchmarked with:

```nushell
seq 0 11 | each { |level|
  let compressed = ($example | to msgpackz --quality $level)
  let time = (timeit { $example | to msgpackz --quality $level })
  {
    level: $level
    time: $time
    length: ($compressed | bytes length)
    ratio: (($uncompressed_length | into float) / ($compressed | bytes length))
  }
}
```

```
╭────┬───────┬─────────────────┬────────┬───────╮
│  # │ level │      time       │ length │ ratio │
├────┼───────┼─────────────────┼────────┼───────┤
│  0 │     0 │ 4ms 611µs 875ns │   3333 │  0.72 │
│  1 │     1 │ 1ms 334µs 500ns │   3333 │  0.72 │
│  2 │     2 │     190µs 333ns │   1185 │  2.02 │
│  3 │     3 │      184µs 42ns │   1128 │  2.12 │
│  4 │     4 │      245µs 83ns │   1098 │  2.18 │
│  5 │     5 │     265µs 584ns │   1040 │  2.30 │
│  6 │     6 │     270µs 792ns │   1040 │  2.30 │
│  7 │     7 │     444µs 708ns │   1040 │  2.30 │
│  8 │     8 │       1ms 801µs │   1040 │  2.30 │
│  9 │     9 │     843µs 875ns │   1037 │  2.31 │
│ 10 │    10 │ 4ms 128µs 375ns │    984 │  2.43 │
│ 11 │    11 │ 6ms 352µs 834ns │    986 │  2.43 │
╰────┴───────┴─────────────────┴────────┴───────╯
```

cc @maxim-uvarov
2024-06-04 17:19:10 -07:00
..
bytes Add string/binary type color to ByteStream (#12897) 2024-05-20 00:35:32 +00:00
charting Replace ExternalStream with new ByteStream type (#12774) 2024-05-16 07:11:18 -07:00
conversions support plus sign for "into filesize" (#12974) 2024-06-05 07:43:50 +08:00
database Replace ExternalStream with new ByteStream type (#12774) 2024-05-16 07:11:18 -07:00
date Make get_full_help take &dyn Command (#12903) 2024-05-19 19:56:33 +02:00
debug Small improvements to debug profile (#12930) 2024-05-22 19:56:51 +03:00
env Remove list support in with-env (#12939) 2024-05-23 13:53:55 +08:00
experimental Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
filesystem Fix touch --reference using PWD from the environment (#12976) 2024-05-26 20:24:00 +03:00
filters Allow byte streams with unknown type to be compatiable with binary (#12959) 2024-05-24 17:54:38 -07:00
formats msgpackz: increase default compression level (#13035) 2024-06-04 17:19:10 -07:00
generators Replace ExternalStream with new ByteStream type (#12774) 2024-05-16 07:11:18 -07:00
hash Make get_full_help take &dyn Command (#12903) 2024-05-19 19:56:33 +02:00
help Make get_full_help take &dyn Command (#12903) 2024-05-19 19:56:33 +02:00
math Make get_full_help take &dyn Command (#12903) 2024-05-19 19:56:33 +02:00
misc Use CommandType in more places (#12832) 2024-05-18 23:37:31 +00:00
network Add string/binary type color to ByteStream (#12897) 2024-05-20 00:35:32 +00:00
path Restore path type behavior (#13006) 2024-05-30 13:42:22 +00:00
platform Add Span merging functions (#12511) 2024-05-16 22:34:49 +00:00
random Make get_full_help take &dyn Command (#12903) 2024-05-19 19:56:33 +02: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 Make get_full_help take &dyn Command (#12903) 2024-05-19 19:56:33 +02:00
strings fix range semantic in detect_columns, str substring, str index-of (#12894) 2024-05-22 20:00:58 +03:00
system Fix run_external::expand_glob() to return paths that are PWD-relative but reflect the original intent (#13028) 2024-06-03 10:38:55 +03:00
viewers Use cwd in grid (#12947) 2024-05-23 20:38:47 +00:00
default_context.rs Add support for the ps command on FreeBSD, NetBSD, and OpenBSD (#12892) 2024-05-22 08:13:45 -07:00
example_test.rs Initial --params implementation (#12249) 2024-03-24 15:40:21 -05:00
lib.rs Initial --params implementation (#12249) 2024-03-24 15:40:21 -05:00
progress_bar.rs Replace ExternalStream with new ByteStream type (#12774) 2024-05-16 07:11:18 -07:00
sort_utils.rs Rename Value::CustomValue to Value::Custom (#12309) 2024-03-27 22:10:56 +01:00