Skip to content

[sidecar] Key validation and TX references allocate per transaction #787

Description

@liran-funaro

Two allocation sites on the mapping path, which is what decides how fast the sidecar allocates — the
collector was 57% of its CPU under load:

  • verifyTxForm allocates a map and the slice its keys are copied into, per namespace, to check for
    duplicate and empty keys. For the key counts that occur in practice a pairwise comparison needs
    neither.
  • TxRef and TxWithRef are allocated twice per transaction, and can be backed by one slice per block.

Together 61 → 56 allocations per transaction, worth 12% at the default GOGC.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions