Skip to content

Investigate stack memory allocation in update #356

@charypar

Description

@charypar

Following the default guidance in the documentation as a Crux app grows, the update function ends up with a potentially very wide Event enum (as in with many variants) and a large match statement.

We should investigate how these two things impact the stack allocation for the update call from the perspecttive of:

  1. allocating space for the event value, especially if some variants carry large types
  2. allocating space for the local variables used in the match arms - early evidence suggests all of the locals get separately allocated, at least in dev mode.

One possible consequence of this investigation is a change to the update function to pass event by borrow, rather than value, for example.

Part of this task is also to establish and document tooling for this type of investigation.

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