Skip to content

MICROPY_QSTR_BYTES_IN_HASH performance/size tradeoff #10151

Open
@dhalbert

Description

@dhalbert

MICROPY_QSTR_BYTES_IN_HASH says how many bytes to reserve for a qstr hash. Typical values are 0, 1, 2.

MicroPython uses 0 for the smallest builds causing a few % penalty in performance. See micropython#12835. MicroPython uses 2 for builds that are not cramped for space, and 1 for others.

CircuitPython uses 1 for everything.

Trinket build delta
0: -640
1: 0 (default)
2: +664

So changing to 0 for tiny builds will get us some extra space, if we need it in the future. I haven't seen a performance chart for 1 vs 2. We could consider 2 for some builds.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions