nushell/crates/nu-color-config/src
Stefan Holderbach ba6f38510c
Shrink Value by boxing Range/Closure (#12784)
# Description
On 64-bit platforms the current size of `Value` is 56 bytes. The
limiting variants were `Closure` and `Range`. Boxing the two reduces the
size of Value to 48 bytes. This is the minimal size possible with our
current 16-byte `Span` and any 24-byte `Vec` container which we use in
several variants. (Note the extra full 8-bytes necessary for the
discriminant or other smaller values due to the 8-byte alignment of
`usize`)

This is leads to a size reduction of ~15% for `Value` and should overall
be beneficial as both `Range` and `Closure` are rarely used compared to
the primitive types or even our general container types.

# User-Facing Changes
Less memory used, potential runtime benefits.

(Too late in the evening to run the benchmarks myself right now)
2024-05-09 08:10:58 +08:00
..
color_config.rs Avoid taking unnecessary ownership of intermediates (#12740) 2024-05-04 00:53:15 +00:00
lib.rs color_config now accepts closures as color values (#7141) 2022-12-17 07:07:56 -06:00
matching_brackets_style.rs Add Value::coerce_str (#11885) 2024-02-18 17:47:10 +01:00
nu_style.rs Name the Value conversion functions more clearly (#11851) 2024-02-17 18:14:16 +00:00
shape_color.rs Avoid taking unnecessary ownership of intermediates (#12740) 2024-05-04 00:53:15 +00:00
style_computer.rs Shrink Value by boxing Range/Closure (#12784) 2024-05-09 08:10:58 +08:00
text_style.rs Update nu-ansi-term, lscolors, and reedline (#9787) 2023-07-24 13:16:18 +02:00