Skip to content

Optimize Wrapper ABI #1

@dOrgJelli

Description

@dOrgJelli

Currently, the WRAP ABI structure has a lot of redundant data. This is because the nested redundant data is useful when generating code, but is unneeded elsewhere.

We should optimize the ABI structure to ensure that it serializes to as small of a size as possible.

Example Optimization

Optimized:

{
  name: "uArrayArray",
  required: true,
  kind: 34,
  array: {
    type: "[[UInt]]",
    required: true,
    kind: 18,
    array: {
      type: "[UInt]",
      kind: 18,
      scalar: {
        type: "UInt",
        kind: 4
      }
    }
  }
}

Original:

{
  type: "[[UInt]]",
  name: "uArrayArray",
  required: true,
  kind: 34,
  array: {
    type: "[[UInt]]",
    name: "uArrayArray",
    required: true,
    kind: 18,
    array: {
      type: "[UInt]",
      name: "uArrayArray",
      kind: 18,
      scalar: {
        type: "UInt",
        name: "uArrayArray",
        kind: 4
      },
      item: {
        type: "UInt",
        name: "uArrayArray",
        kind: 4
      }
    },
    item: {
      type: "[UInt]",
      name: "uArrayArray",
      kind: 18,
      scalar: {
        type: "UInt",
        name: "uArrayArray",
        kind: 4
      },
      item: {
        type: "UInt",
        name: "uArrayArray",
        kind: 4
      }
    }
  }
}

NOTE: we can add back this redundant data using transformations, that way our codegen string templates do not need to be changed.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions