nushell/crates/nu-plugin-engine/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
..
interface ListStream touchup (#12524) 2024-05-05 16:00:59 +00:00
plugin_custom_value_with_source Split the plugin crate (#12563) 2024-04-27 12:08:12 -05:00
util Split the plugin crate (#12563) 2024-04-27 12:08:12 -05:00
context.rs Shrink Value by boxing Range/Closure (#12784) 2024-05-09 08:10:58 +08:00
declaration.rs Split the plugin crate (#12563) 2024-04-27 12:08:12 -05:00
gc.rs Split the plugin crate (#12563) 2024-04-27 12:08:12 -05:00
init.rs Flush on every plugin Data message (#12728) 2024-05-02 23:51:16 +00:00
lib.rs Split the plugin crate (#12563) 2024-04-27 12:08:12 -05:00
persistent.rs Split the plugin crate (#12563) 2024-04-27 12:08:12 -05:00
process.rs Split the plugin crate (#12563) 2024-04-27 12:08:12 -05:00
source.rs Split the plugin crate (#12563) 2024-04-27 12:08:12 -05:00
test_util.rs Split the plugin crate (#12563) 2024-04-27 12:08:12 -05:00