johannesvollmer / exrs

100% Safe Rust OpenEXR file library
Other
154 stars 24 forks source link

Change `convert_current_to_little_endian` to return `Cow<[u8]>` #193

Closed expenses closed 1 year ago

expenses commented 1 year ago

This was a pretty easy change to make. I haven't profiled it but according to heaptrack, this reduces the number of allocations in a benchmark by half:

20230120_19h30m26s_grim 20230120_20h50m04s_grim

johannesvollmer commented 1 year ago

Thanks for the suggestion :) a different PR incorporated these ideas