Skip to content

Speed up encoding #2

Open
Open
@andrewthad

Description

@andrewthad

It should be possible to speed up encoding by doing a machine-word-at-a-time walk of strings, checking if they have any characters that need to be escaped. This includes:

  • Everything < 0x20
  • 0x22 (double quote)
  • Everything >= 0x7F

Surely there's a bit twiddle hack somewhere for this. I've not found it yet, but I'll come up with it if I have to.

If there are no characters that need to be escaped, then memcpy can be used to copy.

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