Where Polkadot is a Leader in the Blockchain Ecosystem

A few protocols in the blockchain ecosystem have also “discovered” Wasm to be a flexible VM to execute their state transition functions, but none have come close to the efficiency of execution provided by Polkadot. Given the importance of Wasm to the Substrate blockchain development framework, a lot of work has been done to optimize the performance of Wasm execution within the Polkadot ecosystem, and it shows:

A report by Pendulum showed that the execution speed of Wasm smart contracts using Substrate’s Contracts Pallet is significantly faster than their EVM counterparts, and the execution of Pallets themselves is off the charts (literally):

(smaller is better)

Wasm is the Performance Power House

We measured the execution time of a variety of benchmark projects. The complete code is available on GitHub. In this article we will only focus on two projects:

  • Odd Numbers: the smart contract takes one argument n and will compute the product of the first n odd numbers (modulo 2**64).
  • SHA-512: the smart contract takes two arguments n and i and will iterate SHA-512 i times on input n, i.e., it will compute SHA(SHA(…(n)…)).

While these are not smart contracts that you will find in the wild, they are useful to measure raw performance. The performance is shown in the bar chart below. Note that the execution time of the pallet is not visible because it is so low (about 1 millisecond only).

Source

This sheds light on just one aspect toward why many teams have decided to create their dApps using ink! or scale their existing dApps onto an application-specific parachain.

11 Likes