Skip to content

Commit 0d0db7b

Browse files
authored
Add reference about PolkaVM throughput benchmarks (polkadot-evm#1709)
1 parent b8ffb4d commit 0d0db7b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

docs/optimization.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,13 @@ We therefore recommend that optimization is focused on **storage IO**, rather th
4646

4747
It's also important to check whether one's blockchain is really already performance-bottlenecked, or it is simply certain parameters set incorrectly. For example, in certain situations, simply raise the block gas limit may be sufficient to increase the throughput.
4848

49-
## Not make things worse
49+
## Notes on PolkaVM
5050

51-
In Polkadot parachains, the performance is bottlenecked by Proof-of-Validity (PoV) size limit. If the smart contract size becomes larger due to VM execution optimization, then this will actually result in worse performance, because now, within the PoV size limit, less contracts can fit. As PolkaVM contracts are usually 10x (sometimes even 80x or more) larger than the equivalent EVM contracts, we recommend that PolkaVM contracts are used only for specifically compute-heavy workload and all other contracts to be deployed in EVM bytecode.
51+
The Frontier project provides optional support of PolkaVM through the `pallet-evm-polkavm` pallet.
52+
53+
However, in Polkadot parachains, the performance is [bottlenecked by Proof-of-Validity (PoV) size limit](https://github.com/paritytech/substrate/issues/9354). If the smart contract size becomes larger due to VM execution optimization, then this will result in worse throughput regardless of VM performance -- within the PoV size limit, less contracts can fit.
54+
55+
At this moment, PolkaVM contracts are usually 10x (sometimes even 80x or more) larger than the equivalent EVM contracts, which means a chain deployed with PolkaVM contracts will have (counterintuitively) less throughput than equivalent EVM contracts. We therefore recommend that PolkaVM contracts are used only for specifically compute-heavy workload and all other contracts to be deployed in EVM bytecode.
5256

5357
[^knuth]: Donald Knuth, *The Art of Computer Programming*
5458
[^zhang]: Hongbo Zhang (Cornell), [*What makes EVM slow?*](https://www.youtube.com/watch?v=2_GX8iCVNrA)

0 commit comments

Comments
 (0)