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.
While trying to implement all validators as closely to each other as possible there are some differences that impact measured script size and execution units.
Plutarch while decoding Data-encoded types is checking for invariants such as hashes lengths, map key ordering etc. which leads to higher start up cost visible in NFT Marketplace validator.
Opshin does expose option to compile without tracing so that is included in the final size. All implementations use traces in their source code but remaining allow to strip it with a compilation flag.
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.
Execution units are abstract units of CEK machine. Despite being called CPU and Memory they DO NOT mean CPU cycles or allocated bytes, these are abstract, deterministic units of the virtual machine that executes UPLC.