Skip to content

Add support for weighting opcodes of different types differently when profilingΒ #81

@TomAFrench

Description

@TomAFrench

We currently support reporting the number of opcodes on each line of Noir source, however a more useful metric is the number of constraints which these opcodes will generate. This is nontrivial as:

  • constraint counts vary by backend
  • certain opcodes have associated fixed costs which are shared between all others of that type.

It's then not possible to give an exact count, what we can do instead is allow an inexact estimation of the opcode->constraint conversion, i.e.:

  • Extension settings allows setting a weight for each opcode e.g. AssertZero == 1, Keccak256== 20000.
  • Reasonable defaults are provided for barretenberg which provides a reasonable estimation of the number of constraints each opcode produces.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions