Skip to content

Reason for using sized integer types in StreamInfo and frame.Header #42

@BenWhetton

Description

@BenWhetton

Hi there! I've been playing around with a small audio streaming project in go using this library. Thanks for the great work :)

I was wondering why you chose to use unsigned and sized integer types for all of the values in StreamInfo? Did you find that this provided a measurable performance benefit?
My expectation would be that using types other than int would provide little to no performance benefits on a 32bit or 64bit architecture. The go documentation recommends generally using int unless there is a specific reason not to.

It makes working with the library quite tedious because of the high number of conversions between integer types required when performing logic or calculations with the StreamInfo and frame.Header fields. One of the first things I have done is write my own equivalent type with ints. I have a strong aversion to boilerplate unless it serves a purpose so it'd be good to understand what drove this decision.

I'd be happy to submit a pull request if you think that this would be a good change. However it would be a breaking change so perhaps best bundled with other breaking changes for a future major release.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions