Skip to content

append is a bit inefficient when bytestrings are short #462

@treeowl

Description

@treeowl

append unconditionally uses FFI calls to memcpy for both bytestrings. If one or both of them are known at compile time to be very short, this is inefficient. I believe there's a very simple solution: just use GHC primops to do the copying instead of FFI. When there's a known short length to copy, instructions will be emitted to copy directly; otherwise the compiler will use an FFI call. No need to do this so manually.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions