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 noticed your ByteBuffergrows via append, whereas we know the bytes.Buffergrows by hand-coded comparison of cap/len and enlarging/copying when needed.
For this very small specific sub-aspect of your overall buffer-pool project, did you bench both approaches? Did you:
verify append to be visibly, noticably, consistently "faster"/more-performant (perhaps because it compiles to better asm..) than a hand-rolled grow logic?
or did you just go for append for the simplicity? 😏
I'm curious in this mainly because I too keep around a lean tiny private alternative to bytes.Buffer (without your pooling aspects — not needed so far) and I was wondering if append might not be "intrinsically preferable", after all this growth logic is exactly its purpose. 😁 but then it makes me wonder why bytes.Buffer went for hand-rolled growth and avoiding append.
Since you have seen more heavy loads in your real-world projects so far than I did in my still-toy-stage usage so far, I figured you're the guy whose opinion to ask! =)
The text was updated successfully, but these errors were encountered:
I noticed your
ByteBuffer
grows viaappend
, whereas we know thebytes.Buffer
grows by hand-coded comparison ofcap
/len
and enlarging/copy
ing when needed.For this very small specific sub-aspect of your overall buffer-pool project, did you bench both approaches? Did you:
append
to be visibly, noticably, consistently "faster"/more-performant (perhaps because it compiles to better asm..) than a hand-rolled grow logic?append
for the simplicity? 😏I'm curious in this mainly because I too keep around a lean tiny private alternative to
bytes.Buffer
(without your pooling aspects — not needed so far) and I was wondering ifappend
might not be "intrinsically preferable", after all this growth logic is exactly its purpose. 😁 but then it makes me wonder whybytes.Buffer
went for hand-rolled growth and avoidingappend
.Since you have seen more heavy loads in your real-world projects so far than I did in my still-toy-stage usage so far, I figured you're the guy whose opinion to ask! =)
The text was updated successfully, but these errors were encountered: