Decompose storage into several cells.
Clarification and motivation
There are many unnecessary packing and unpacking of storage values. Let's decompose it to several cells on stack and just access to them.
I suggest doing it by adding one more constructor to Var
, which would correspond to a decomposed value, containing Rec Var
of fields.
Tricky part of this task is what to do when we met a decomposed variable in an expression. There are plenty of not-trivial solution, but let's implement the simplest one first: let's just materialise this variable to a composed value on stack.
The another tricky question: how to implement setField
for a decomposed variable. It can be done recursively, using dig/dug
There are plenty place for optimisations:
- don't materialise a decomposed variable in expressions together with copy-on-write semantic
- lazy decompose materialised variable into pieces (keeping fields materliazed until they are really needed)
The following tasks will be created later, after this one is done.
Acceptance criteria
Edited by Ilya Peresadin