Skip to content

See if there's any benefit to adding more specialized methods to WriteBuffer #1137

Description

@popematt
         buffer.writeFlexUInt(2)
         buffer.writeFixedIntOrUInt(bits, 2)

This pattern recurs frequently. I wonder if it would be (marginally) faster to have a method variant that does both in one step.

Originally posted by @tgregg in #1133 (comment)

E.g.:

buffer.writeFixedIntWithLengthPrefix(2, bits)

or:

buffer.writeFixedIntWithLengthPrefix2(bits)

Although, we may see some benefit just from having constants for more FlexUInt values. E.g.:

buffer.writeByte(FlexInt.TWO)
buffer.writeFixedInt2(bits)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions