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 calling writeByte, which requires some redundant logic. See e.g. writeUInt64 vs writeUInt64Slow.
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)
Originally posted by @tgregg in #609 (comment)
Originally posted by @tgregg in #610 (comment)
Originally posted by @tgregg in #612 (comment)