Skip to content

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

@popematt

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)

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