nushell/crates/nu-protocol/src/value
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
..
custom_value.rs Make drop notification timing for plugin custom values more consistent (#12341) 2024-04-04 09:13:25 +02:00
duration.rs Restructure nu-protocol in more meaningful units (#11917) 2024-03-10 18:45:45 +01:00
filesize.rs Remove some macros (#12742) 2024-05-03 10:35:37 +02:00
from_value.rs Shrink Value by boxing Range/Closure (#12784) 2024-05-09 08:10:58 +08:00
from.rs Spanned Value step 1: span all value cases (#10042) 2023-08-25 08:48:05 +12:00
glob.rs ls, rm, cp, open, touch, mkdir: Don't expand tilde if input path is quoted string or a variable. (#12232) 2024-03-25 10:08:38 +08:00
mod.rs Shrink Value by boxing Range/Closure (#12784) 2024-05-09 08:10:58 +08:00
range.rs Range refactor (#12405) 2024-04-06 09:04:56 -05:00
record.rs Impl FusedIterator for record iterators (#12542) 2024-04-17 00:34:16 +02:00