Skip to content

Optimize struct unpacking #7

Closed
Closed
@tannewt

Description

@tannewt
x = struct.unpack('<h', data[0:2])[0]
y = struct.unpack('<h', data[2:4])[0]
z = struct.unpack('<h', data[4:6])[0]

Slicing data causes an extra allocation. Struct should be able to take the whole buffer and split out the values at once.

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