This website provides interactive visualizations of Plutus Core builtin function cost models. Each visualization displays benchmark data alongside fitted cost model predictions, allowing developers and stakeholders to understand the performance characteristics of builtin functions.
Cost models are critical for ensuring accurate script execution costs on the Cardano blockchain. These visualizations help verify that the mathematical models accurately represent the actual execution time measured during benchmarking.
Converts a Plutus Value to Data representation.
(2D visualization: Value Size vs Time)
Converts Data representation back to a Plutus Value.
(2D visualization: Data Size vs Time)
Checks if a Plutus Value (haystack) contains another Value (needle).
(3D visualization: Container Size × Contained Size × Time)
Looks up a specific coin (currency symbol and token name) in a Plutus Value.
(2D visualization: Value Size vs Time)
All visualizations load data directly from the official Plutus repository:
Data is fetched dynamically using the browser's fetch() API, ensuring you always see
the latest benchmarks and cost models from the master branch.
Developers can easily add visualizations for additional builtin functions by following these steps:
cp -r valuedata/ myfunction/
myfunction/index.html:
myfunction/plot.js:
FUNCTION_NAME constant (must match CSV entry exactly)ARITY constant (number of arguments for overhead calculation)renderPlot() functionpython -m http.server 8000
# Visit http://localhost:8000/myfunction/
index.html to include your function in the listbuiltinCostModelC.json
shared/utils.js
For a 2D plot with a single argument:
const FUNCTION_NAME = 'MyFunction'; // Must match CSV
const ARITY = 1; // Number of arguments
// In renderPlot():
const benchmarkX = benchmarkData.map(d => d.args[0]); // First argument
const benchmarkY = benchmarkData.map(d => d.time); // Time (always Y)
For a 3D plot with two arguments:
const FUNCTION_NAME = 'MyFunction';
const ARITY = 2;
// In renderPlot():
const benchmarkX = benchmarkData.map(d => d.args[0]); // First argument
const benchmarkY = benchmarkData.map(d => d.args[1]); // Second argument
const benchmarkZ = benchmarkData.map(d => d.time); // Time (always Z)
This is a static website built with plain HTML, CSS, and JavaScript. It uses Plotly.js for interactive plotting. No build tools or frameworks are required.
The website implements JavaScript evaluators for various cost model types (linear, quadratic, multi-dimensional, etc.). Model predictions are calculated at the same input points as the benchmark data to enable direct comparison.
Overhead values are automatically calculated from Nop benchmarks in the CSV file.
The overhead for a given arity is added to all model predictions to account for the base cost
of function invocation and result handling.
This site can be deployed to GitHub Pages or any static hosting service. For local development, simply run a local HTTP server in the project directory:
python -m http.server 8000
# or
python3 -m http.server 8000