Skip to content

Optimization: Remove Protocols and move to concrete base classes, to optimize out witness table lookup #18

@vade

Description

@vade

Fabric benefitted from removing as? casts in tight loops due to testing for protocol conformance.

This can be optimized by moving types to the a concrete implementation, allow for is checks for as? and avoiding witness table lookup.

The largest opportunity for a win is inside of updateLists recursive gathering / testing for types, which on larger scenes eats a decent chunk of time.

  • Light
  • Renderable
  • IBLScene
  • VertexAttribute
  • BindableBuffer

Parameter isnt in the hot rendering path (as far as ive seen) so likely fine to keep as is.

  • Parameter

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