linera-io / linera-protocol

Main repository for the Linera protocol
Apache License 2.0
112 stars 97 forks source link

Reduce stack memory usage #2066

Open jvff opened 2 months ago

jvff commented 2 months ago

Motivation

It is not uncommon during development to run into stack overflows. This occurs due to a few factors, such as placing large objects in the stack, calling asynchronous functions that result in large futures placed on the stack, and deep calls.

Proposal

Ideally stack usage should be measured to find the places in the code that are using most of the stack. Some ideas that might reduce the usage include:

ma2bd commented 2 months ago

See https://swatinem.de/blog/future-size/

Twey commented 1 day ago

Re-opening this as the boxing marked with it in the codebase cannot yet be removed.