nushell/crates
Stefan Holderbach a52386e837
Box ShellError in Value::Error (#8375)
# Description

Our `ShellError` at the moment has a `std::mem::size_of<ShellError>` of
136 bytes (on AMD64). As a result `Value` directly storing the struct
also required 136 bytes (thanks to alignment requirements).

This change stores the `Value::Error` `ShellError` on the heap.

Pro:
- Value now needs just 80 bytes
- Should be 1 cacheline less (still at least 2 cachelines)

Con:
- More small heap allocations when dealing with `Value::Error`
  - More heap fragmentation
  - Potential for additional required memcopies

# Further code changes

Includes a small refactor of `try` due to a type mismatch in its large
match.

# User-Facing Changes

None for regular users.

Plugin authors may have to update their matches on `Value` if they use
`nu-protocol`

Needs benchmarking to see if there is a benefit in real world workloads.
**Update** small improvements in runtime for workloads with high volume
of values. Significant reduction in maximum resident set size, when many
values are held in memory.

# Tests + Formatting
2023-03-12 09:57:27 +01:00
..
nu_plugin_custom_values Document and critically review ShellError variants - Ep. 3 (#8340) 2023-03-06 18:33:09 +01:00
nu_plugin_example Update to 0.76.1 version for development (#8161) 2023-02-21 23:21:39 +00:00
nu_plugin_formats Box ShellError in Value::Error (#8375) 2023-03-12 09:57:27 +01:00
nu_plugin_gstat Update to 0.76.1 version for development (#8161) 2023-02-21 23:21:39 +00:00
nu_plugin_inc Update to 0.76.1 version for development (#8161) 2023-02-21 23:21:39 +00:00
nu_plugin_python update nu_plugin_python due to signature changes (#8107) 2023-02-18 13:27:24 +00:00
nu_plugin_query Bump scraper from 0.14.0 to 0.15.0 (#8331) 2023-03-05 19:37:22 -08:00
nu-cli Box ShellError in Value::Error (#8375) 2023-03-12 09:57:27 +01:00
nu-cmd-lang Box ShellError in Value::Error (#8375) 2023-03-12 09:57:27 +01:00
nu-color-config Display empty records and lists (#7925) 2023-02-22 16:18:33 +00:00
nu-command Box ShellError in Value::Error (#8375) 2023-03-12 09:57:27 +01:00
nu-engine Box ShellError in Value::Error (#8375) 2023-03-12 09:57:27 +01:00
nu-explore Box ShellError in Value::Error (#8375) 2023-03-12 09:57:27 +01:00
nu-glob Update to 0.76.1 version for development (#8161) 2023-02-21 23:21:39 +00:00
nu-json README for nu-json. Related to nushell/nushell#8253 (#8289) 2023-03-03 19:07:25 -06:00
nu-parser Allow aliasing parser keywords (#8250) 2023-03-10 23:20:31 +02:00
nu-path Update to 0.76.1 version for development (#8161) 2023-02-21 23:21:39 +00:00
nu-plugin Document and critically review ShellError variants - Ep. 3 (#8340) 2023-03-06 18:33:09 +01:00
nu-pretty-hex Update to 0.76.1 version for development (#8161) 2023-02-21 23:21:39 +00:00
nu-protocol Box ShellError in Value::Error (#8375) 2023-03-12 09:57:27 +01:00
nu-system Bump nix from 0.25.0 to 0.26.2 (#8129) 2023-03-12 09:03:02 +01:00
nu-table table --collapse dont do truncation return message instead (#8172) 2023-02-22 18:35:45 +00:00
nu-term-grid Update to 0.76.1 version for development (#8161) 2023-02-21 23:21:39 +00:00
nu-test-support Put a lock around cargo build invocations for plugin tests (#8333) 2023-03-05 19:04:12 -08:00
nu-utils add dirs command to std lib (#8368) 2023-03-11 16:31:09 -06:00
README.md Remove old nushell/merge engine-q 2022-02-07 14:54:06 -05:00

Nushell core libraries and plugins

These sub-crates form both the foundation for Nu and a set of plugins which extend Nu with additional functionality.

Foundational libraries are split into two kinds of crates:

  • Core crates - those crates that work together to build the Nushell language engine
  • Support crates - a set of crates that support the engine with additional features like JSON support, ANSI support, and more.

Plugins are likewise also split into two types:

  • Core plugins - plugins that provide part of the default experience of Nu, including access to the system properties, processes, and web-connectivity features.
  • Extra plugins - these plugins run a wide range of different capabilities like working with different file types, charting, viewing binary data, and more.