You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tested the following variation and it made an astonishing 20% difference in the bench_log benchmarks (294 MB/s vs 244 MB/s).
if value == 0{self.writer.write_all(b"0").map_err(From::from)}else{letmut scratch = [0u8;20];letmut len = 0;while value > 0{
scratch[19 - len] = (value % 10)asu8 + b'0';
value /= 10;
len += 1;}self.writer.write_all(&scratch[20-len..20]).map_err(From::from)}
That is enough to motivate looking for a better solution, or contributing a fix to Rust for whatever is making write! slow.
The text was updated successfully, but these errors were encountered:
The fmt method I linked to is way faster than mine. All the slowness comes from pad_integral which we shouldn't even need because we want the default format. I will look for a way to avoid going through pad_integral.
It currently looks like this:
I tested the following variation and it made an astonishing 20% difference in the bench_log benchmarks (294 MB/s vs 244 MB/s).
That is enough to motivate looking for a better solution, or contributing a fix to Rust for whatever is making
write!
slow.The text was updated successfully, but these errors were encountered: