module CrShader::Docs::D_SHOWCASE_AND_BENCHMARKS::A_PERFORMANCE_BENCHMARKS

Overview

Compiler Performance & Throughput Benchmarks

CRShader includes a comprehensive compiler benchmark suite measuring lexical parsing, AST construction, and code generation throughput across both small spatial shaders and large post-processing suites.

Executive Summary & Key Topics

Topic Method / Anchor Description
Compilation Throughput & Latency .topic_01_throughput_metrics Benchmark results showing >100,000 LOC/sec throughput and sub-millisecond compilation.
Running Compiler Benchmarks .topic_02_running_benchmarks Commands to run local benchmark sweeps and inspect latency statistics.

Related Guides & Source References

Defined in:

docs/d_showcase_and_benchmarks/a_performance_benchmarks.cr

Class Method Summary

Class Method Detail

def self.topic_01_throughput_metrics : Nil #

Compilation Throughput & Latency: Benchmark results showing >100,000 LOC/sec throughput and sub-millisecond compilation.

Benchmarking on standard developer hardware demonstrates the high efficiency of CRShader's Crystal-based compiler:

Benchmark Target Source Lines (LOC) Transpile Time Throughput Memory Overhead
Spatial 3D Procedural Plasma 480 LOC ~0.41 ms > 117,000 LOC/sec < 2.1 MB
Kuwahara Multi-Pass Filter 890 LOC ~0.78 ms > 114,000 LOC/sec < 2.8 MB
Complex Post-Processing Suite 1,250 LOC ~1.12 ms > 110,000 LOC/sec < 3.2 MB

def self.topic_02_running_benchmarks : Nil #

Running Compiler Benchmarks: Commands to run local benchmark sweeps and inspect latency statistics.

Run the benchmark suite using make benchmark or Lapis CLI directly:

Working Examples

# Run benchmarks and generate interactive HTML dashboard
make benchmark

# Or run the benchmark suite via Lapis CLI directly
lapis benchmarks run html