Introduction

Cardano smart-contract language ecosystem develops rapidly and offers many languages without a single and comprehensive performance comparison. The purpose of Cardano onchain language benchmark project is to implement the same suite of Cardano onchain validators in multiple languages compiled to UPLC, develop a language-agnostic test suite to test the equivalence of validators, and measure the performance of each language looking at script size and execution units.

Specifications of validators that are to be implemented in each language are available here.

Benchmark results, when available, will be published on this website.

Everything, including specifications and this website is open-source and available on GitHub.

Specifications

Comparison

Script size (bytes)

Script sizes are compared by compiling each script to CBOR and taking its binary size in bytes. Validators are compiled without traces if language supports it (Opshin does not) and are not passed through any external UPLC optimizer.

size plot

Languagelp-minting-policy.binnft-marketplace-validator.binnft-minting-policy.binpool-validator.bin
Plutarch33412196401631
Aiken5357957811550
PlutusTx1848343323793171
Opshin1412263420024169

Raw script size data

Execution Units

LP Policy - mint one

execution_units plot

LanguageCPUMemory
Plutarch2186615654994
Aiken2908964683264
PlutusTx112521772369282
Opshin49371325153098

Raw execution units data

LP Policy - mint two

execution_units plot

LanguageCPUMemory
Plutarch3775657290081
Aiken45968980130219
PlutusTx129561365424596
Opshin78653774234077

Raw execution units data

Pool NFT Policy - mint

execution_units plot

LanguageCPUMemory
Plutarch2949736176787
Aiken3716775199173
PlutusTx153008441504397
Opshin56304254182358

Raw execution units data

Pool Validator - swap A for B

execution_units plot

LanguageCPUMemory
Plutarch153757103376495
Aiken160591359442544
PlutusTx4346053391492262
Opshin328459639936125

Raw execution units data

Pool Validator - swap B for A

execution_units plot

LanguageCPUMemory
Plutarch153757103376495
Aiken160591359442544
PlutusTx4346053391492262
Opshin328459639936125

Raw execution units data

Pool Validator - deposit

execution_units plot

LanguageCPUMemory
Plutarch155335291379259
Aiken166710755461160
PlutusTx4881351511682058
Opshin332265515940848

Raw execution units data

Pool Validator - withdraw

execution_units plot

LanguageCPUMemory
Plutarch156466269381663
Aiken167841733463564
PlutusTx4895326501686860
Opshin333153004943450

Raw execution units data

NFT Marketplace - buy one

execution_units plot

LanguageCPUMemory
Plutarch44577866125010
Aiken3065588280452
PlutusTx216310996739238
Opshin60101506192397

Raw execution units data

NFT Marketplace - cancel one

execution_units plot

LanguageCPUMemory
Plutarch38719357115390
Aiken2400584271296
PlutusTx133127717443664
Opshin43609505143722

Raw execution units data