Skip to content

Revisit String performance #620

@anthony-swirldslabs

Description

@anthony-swirldslabs

UTF-8 encoding takes time. Many times, we don't even use strings that we parse (e.g. memo fields and similar). So PBJ may be wasting time encoding them when parsing objects.

The idea is to store strings as original byte[] objects in models and only perform the encoding if/when someone calls a getter on the model for the string. If the getter is never called, then we never need to waste cycles on the encoding.

A PoC of this change is available at #612

The task is to extract it, get it to the production level, and release the change.

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