Skip to content

Consider using a pointer offset instead of a slice and integer position #210

Open
@jdm

Description

@jdm

The generated assembly for code using next_byte_unchecked like skip_whitespace has a suprising number of indirections in order to actually get the byte value. This is caused by the need to get the slice, then get the byte at the desired offset from it at

self.input.as_bytes()[self.position + offset]
. If we use store a pointer and increase its instead of the offset, it should cause more efficient code to be generated.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions