-
Notifications
You must be signed in to change notification settings - Fork 125
Description
As an optimization, we could go into the fallback loop branch if
remaining() < numBytes, then in the short branches we can write directly into the buffer rather than repetitively callingwriteByte, which requires some redundant logic. See e.g.writeUInt64vswriteUInt64Slow.
Originally posted by @tgregg in #609 (comment)
As an optimization, we could have fast/slow variants of this too, where we do the current technique when
remaining() < numBytes, and otherwise we just write directly into the underlying array.
Originally posted by @tgregg in #610 (comment)
This might be a good candidate for a method in WriteBuffer. I have a feeling it will ultimately benefit from an optimization that writes directly into the WriteBuffer's array if enough space is available.
Originally posted by @tgregg in #612 (comment)