Closed skrzypo987 closed 3 years ago
cc @martint @electrum
Have you seen any cases where this matters? This method is called once per invocation to Slice.fill()
, and the bulk of the time spent in that method is replicating the long across the whole buffer. I suspect it will only have an impact when making lots of calls to Slice.fill()
on very small slice objects.
Have you seen any cases where this matters? This method is called once per invocation to
Slice.fill()
, and the bulk of the time spent in that method is replicating the long across the whole buffer. I suspect it will only have an impact when making lots of calls toSlice.fill()
on very small slice objects.
I observed an actual gain with slices of size ~100 bytes. The difference is small but measurable. I used only slices with sizes that are a multiple of 8 so I guess either JIT or the CPU branch prediction got rid of the second loop in the fill
method making this matter slightly more.
SImple benchmarks show 600/s -> 1300/s