raylib performance — backend comparison

rlgl  vs  rlmtl_mesa  |  GPU Apple M5 (24576 MB)  |  Driver MoltenVK 1.4.1  |  OS macOS 26.5.1  |  10 runs × 60000 ms full speed

Green = best backend for that example/metric, red = worst. Frame time & FPS are the representative run; software (rlsw) has no GPU so its VRAM is ~0. Shader-heavy examples may not execute custom shaders on the software backend.

° = at that backend's floor (median within 15% of its own bench_idle median): the scene finishes its real work faster than one present/loop turnaround, so the number measures presentation pacing or loop overhead, not rendering cost, and cross-backend ratios there compare present plumbing.

rlmtl_mesa = the native Metal backend + Mesa's shader compiler. This column runs rlmtl's stock pipeline (GLSL → shaderc → SPIR-V → SPIRV-Cross → MSL) on every scene except performance_stress_test_direct, whose fragment shader is precompiled offline by raylib/tools/nir2msl through Mesa's NIR→MSL compiler (the KosmicKrisp backend's kosmicomp, MIT) and injected via RLMTL_MSL_OVERRIDE. On that scene SPIRV-Cross's flattened-SSA output defeats Metal's optimizer; Mesa's NIR pipeline is the only automatic GLSL translation measured faster than Apple's own GL compiler — 231.6 ±14 vs 247.4 ±9 ms over 10 interleaved cycles (2026-08-18), ahead of hand-written MSL (250), ANGLE (281), Slang (289), naga (322) and stock SPIRV-Cross (442). Pixel drift vs SPIRV-Cross is ULP-class only (84% of differing channels off by 1, max 17/255; Mesa lowers sin/cos to conformant polynomials).

speedup = rlmtl_mesa relative to rlgl, per metric direction (>1x favors rlmtl_mesa_macos_apple/bench_instanced/run_16.rini); ° on a ratio means at least one side sits at its floor, so it compares present plumbing.

Frames per second (higher is better)

Sustained FPS at full speed (uncapped).
Examplerlglrlmtl_mesarlmtl_mesa speedup
shapes_basic_shapes6801°179382.64x°
textures_tiled_drawing6380°151152.37x°
textures_particles_blending5956°98961.66x°
shapes_starfield_effect6605°188242.85x°
models_loading246913760°5.57x°
models_heightmap_rendering2157125645.83x
models_skybox_rendering2590157856.09x
models_waving_cubes24912374.97x
models_first_person_maze7757°13734°1.77x°
core_3d_camera_free2591179056.91x
shaders_basic_lighting361990262.49x
shaders_basic_pbr335249151.47x
shaders_mandelbrot_set115841463.58x
shaders_raymarching_rendering2762320.84x
performance_stress_test831631.97x
performance_stress_test_direct441.09x
bench_idle5779°14756°2.55x°
bench_drawcalls120215117.90x
bench_instanced517819915.86x

Median frame time, ms (lower is better)

Median per-frame CPU wall time.
Examplerlglrlmtl_mesarlmtl_mesa speedup
shapes_basic_shapes0.134°0.0413.27x°
textures_tiled_drawing0.145°0.0403.61x°
textures_particles_blending0.164°0.0712.32x°
shapes_starfield_effect0.142°0.0423.41x°
models_loading0.3680.033°11.30x°
models_heightmap_rendering0.4010.0478.43x
models_skybox_rendering0.3590.0399.28x
models_waving_cubes4.0390.8035.03x
models_first_person_maze0.123°0.035°3.51x°
core_3d_camera_free0.3590.0418.82x
shaders_basic_lighting0.2690.0823.26x
shaders_basic_pbr0.2870.1771.62x
shaders_mandelbrot_set0.8270.2363.50x
shaders_raymarching_rendering3.5004.0140.87x
performance_stress_test11.6685.9651.96x
performance_stress_test_direct247.350231.6061.07x
bench_idle0.157°0.031°5.00x°
bench_drawcalls7.9580.47416.79x
bench_instanced1.6670.11414.58x

Average frame time, ms (lower is better)

Mean per-frame wall time.
Examplerlglrlmtl_mesarlmtl_mesa speedup
shapes_basic_shapes0.148°0.0562.64x°
textures_tiled_drawing0.158°0.0662.39x°
textures_particles_blending0.172°0.1011.70x°
shapes_starfield_effect0.152°0.0532.87x°
models_loading0.4050.073°5.58x°
models_heightmap_rendering0.4650.0805.83x
models_skybox_rendering0.3860.0636.09x
models_waving_cubes4.0380.8094.99x
models_first_person_maze0.129°0.073°1.77x°
core_3d_camera_free0.3860.0566.91x
shaders_basic_lighting0.2780.1112.50x
shaders_basic_pbr0.3010.2041.48x
shaders_mandelbrot_set0.8640.2413.58x
shaders_raymarching_rendering3.6314.3060.84x
performance_stress_test12.0896.1471.97x
performance_stress_test_direct248.378228.2191.09x
bench_idle0.175°0.068°2.59x°
bench_drawcalls8.3200.46517.88x
bench_instanced1.9350.12215.86x

CPU utilization, %

Average process CPU as percent of the whole machine.
Examplerlglrlmtl_mesarlmtl_mesa speedup
shapes_basic_shapes12.713.50.94x
textures_tiled_drawing12.513.40.93x
textures_particles_blending12.816.60.77x
shapes_starfield_effect12.515.20.83x
models_loading5.610.00.56x
models_heightmap_rendering5.012.40.40x
models_skybox_rendering5.711.70.49x
models_waving_cubes8.311.60.72x
models_first_person_maze12.810.41.22x
core_3d_camera_free5.912.80.46x
shaders_basic_lighting12.814.90.86x
shaders_basic_pbr11.98.51.40x
shaders_mandelbrot_set4.08.40.48x
shaders_raymarching_rendering1.00.51.88x
performance_stress_test10.210.40.98x
performance_stress_test_direct0.00.01.12x
bench_idle12.49.31.33x
bench_drawcalls10.012.10.82x
bench_instanced6.916.80.41x

RAM, MB

Average working-set memory.
Examplerlglrlmtl_mesarlmtl_mesa speedup
shapes_basic_shapes87.483.81.04x
textures_tiled_drawing87.984.31.04x
textures_particles_blending87.783.91.05x
shapes_starfield_effect87.183.91.04x
models_loading103.599.61.04x
models_heightmap_rendering92.890.11.03x
models_skybox_rendering148.0161.90.91x
models_waving_cubes87.9100.70.87x
models_first_person_maze88.884.91.05x
core_3d_camera_free86.783.71.03x
shaders_basic_lighting94.4102.20.92x
shaders_basic_pbr132.9140.80.94x
shaders_mandelbrot_set86.6100.80.86x
shaders_raymarching_rendering87.3119.10.73x
performance_stress_test122.8164.10.75x
performance_stress_test_direct86.5102.90.84x
bench_idle86.983.41.04x
bench_drawcalls89.584.81.06x
bench_instanced88.3103.90.85x

GPU VRAM, MB

Average per-process video memory.
Examplerlglrlmtl_mesarlmtl_mesa speedup
shapes_basic_shapes0.00.0
textures_tiled_drawing0.00.0
textures_particles_blending0.00.0
shapes_starfield_effect0.00.0
models_loading0.00.0
models_heightmap_rendering0.00.0
models_skybox_rendering0.00.0
models_waving_cubes0.00.0
models_first_person_maze0.00.0
core_3d_camera_free0.00.0
shaders_basic_lighting0.00.0
shaders_basic_pbr0.00.0
shaders_mandelbrot_set0.00.0
shaders_raymarching_rendering0.00.0
performance_stress_test0.00.0
performance_stress_test_direct0.00.0
bench_idle0.00.0
bench_drawcalls0.00.0
bench_instanced0.00.0