u32-table row count grew a lot with 0.42-alpha 6 #312
Labels
🕵 investigation
This design change might improve the VM
🟢 prio: low
Not at all urgent
⏪ slowdown
Makes stuff go slower.
The u32 table row count has grown a lot with the latest release, v0.42-alpha6. The new u32 check in
merkle_step
seems to be the culprit.Here's the diff for the benchmark result of the
tasm-lib
snippettasmlib_hashing_merkle_verify
. Notice that the u32-table row count is increased by a factor of 10 in the "worst-case" benchmark where a leaf in a Merkle tree of height 20 is verified. It seems to me that we're paying full cost for each u32 check inmerkle_step
, every time this instruction is executed. I though, because of the look-up nature of the u32 table, that only the 1st iteration of amerkle_step recurse_or_return
loop would pay a price in terms of u32-table rows.Also in tasm-lib's
The u32-table row count is now so high that it's not too far off being the bottleneck in the TASM implementation of the verifier. We have:
So the u32-table row count almost tripled with alpha-6, because of the u32 check in each iteration of
merkle_step
. Still not the bottleneck, but I don't think this performance was what we expected when adding this check.The text was updated successfully, but these errors were encountered: