Skip to content

Consider writing directly to the backing array in WriteBuffer #613

@popematt

Description

@popematt

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions