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).| Example | rlgl | rlmtl_mesa | rlmtl_mesa speedup |
|---|
| shapes_basic_shapes | 6801° | 17938 | 2.64x° |
| textures_tiled_drawing | 6380° | 15115 | 2.37x° |
| textures_particles_blending | 5956° | 9896 | 1.66x° |
| shapes_starfield_effect | 6605° | 18824 | 2.85x° |
| models_loading | 2469 | 13760° | 5.57x° |
| models_heightmap_rendering | 2157 | 12564 | 5.83x |
| models_skybox_rendering | 2590 | 15785 | 6.09x |
| models_waving_cubes | 249 | 1237 | 4.97x |
| models_first_person_maze | 7757° | 13734° | 1.77x° |
| core_3d_camera_free | 2591 | 17905 | 6.91x |
| shaders_basic_lighting | 3619 | 9026 | 2.49x |
| shaders_basic_pbr | 3352 | 4915 | 1.47x |
| shaders_mandelbrot_set | 1158 | 4146 | 3.58x |
| shaders_raymarching_rendering | 276 | 232 | 0.84x |
| performance_stress_test | 83 | 163 | 1.97x |
| performance_stress_test_direct | 4 | 4 | 1.09x |
| bench_idle | 5779° | 14756° | 2.55x° |
| bench_drawcalls | 120 | 2151 | 17.90x |
| bench_instanced | 517 | 8199 | 15.86x |
Median frame time, ms (lower is better)
Median per-frame CPU wall time.| Example | rlgl | rlmtl_mesa | rlmtl_mesa speedup |
|---|
| shapes_basic_shapes | 0.134° | 0.041 | 3.27x° |
| textures_tiled_drawing | 0.145° | 0.040 | 3.61x° |
| textures_particles_blending | 0.164° | 0.071 | 2.32x° |
| shapes_starfield_effect | 0.142° | 0.042 | 3.41x° |
| models_loading | 0.368 | 0.033° | 11.30x° |
| models_heightmap_rendering | 0.401 | 0.047 | 8.43x |
| models_skybox_rendering | 0.359 | 0.039 | 9.28x |
| models_waving_cubes | 4.039 | 0.803 | 5.03x |
| models_first_person_maze | 0.123° | 0.035° | 3.51x° |
| core_3d_camera_free | 0.359 | 0.041 | 8.82x |
| shaders_basic_lighting | 0.269 | 0.082 | 3.26x |
| shaders_basic_pbr | 0.287 | 0.177 | 1.62x |
| shaders_mandelbrot_set | 0.827 | 0.236 | 3.50x |
| shaders_raymarching_rendering | 3.500 | 4.014 | 0.87x |
| performance_stress_test | 11.668 | 5.965 | 1.96x |
| performance_stress_test_direct | 247.350 | 231.606 | 1.07x |
| bench_idle | 0.157° | 0.031° | 5.00x° |
| bench_drawcalls | 7.958 | 0.474 | 16.79x |
| bench_instanced | 1.667 | 0.114 | 14.58x |
Average frame time, ms (lower is better)
Mean per-frame wall time.| Example | rlgl | rlmtl_mesa | rlmtl_mesa speedup |
|---|
| shapes_basic_shapes | 0.148° | 0.056 | 2.64x° |
| textures_tiled_drawing | 0.158° | 0.066 | 2.39x° |
| textures_particles_blending | 0.172° | 0.101 | 1.70x° |
| shapes_starfield_effect | 0.152° | 0.053 | 2.87x° |
| models_loading | 0.405 | 0.073° | 5.58x° |
| models_heightmap_rendering | 0.465 | 0.080 | 5.83x |
| models_skybox_rendering | 0.386 | 0.063 | 6.09x |
| models_waving_cubes | 4.038 | 0.809 | 4.99x |
| models_first_person_maze | 0.129° | 0.073° | 1.77x° |
| core_3d_camera_free | 0.386 | 0.056 | 6.91x |
| shaders_basic_lighting | 0.278 | 0.111 | 2.50x |
| shaders_basic_pbr | 0.301 | 0.204 | 1.48x |
| shaders_mandelbrot_set | 0.864 | 0.241 | 3.58x |
| shaders_raymarching_rendering | 3.631 | 4.306 | 0.84x |
| performance_stress_test | 12.089 | 6.147 | 1.97x |
| performance_stress_test_direct | 248.378 | 228.219 | 1.09x |
| bench_idle | 0.175° | 0.068° | 2.59x° |
| bench_drawcalls | 8.320 | 0.465 | 17.88x |
| bench_instanced | 1.935 | 0.122 | 15.86x |
CPU utilization, %
Average process CPU as percent of the whole machine.| Example | rlgl | rlmtl_mesa | rlmtl_mesa speedup |
|---|
| shapes_basic_shapes | 12.7 | 13.5 | 0.94x |
| textures_tiled_drawing | 12.5 | 13.4 | 0.93x |
| textures_particles_blending | 12.8 | 16.6 | 0.77x |
| shapes_starfield_effect | 12.5 | 15.2 | 0.83x |
| models_loading | 5.6 | 10.0 | 0.56x |
| models_heightmap_rendering | 5.0 | 12.4 | 0.40x |
| models_skybox_rendering | 5.7 | 11.7 | 0.49x |
| models_waving_cubes | 8.3 | 11.6 | 0.72x |
| models_first_person_maze | 12.8 | 10.4 | 1.22x |
| core_3d_camera_free | 5.9 | 12.8 | 0.46x |
| shaders_basic_lighting | 12.8 | 14.9 | 0.86x |
| shaders_basic_pbr | 11.9 | 8.5 | 1.40x |
| shaders_mandelbrot_set | 4.0 | 8.4 | 0.48x |
| shaders_raymarching_rendering | 1.0 | 0.5 | 1.88x |
| performance_stress_test | 10.2 | 10.4 | 0.98x |
| performance_stress_test_direct | 0.0 | 0.0 | 1.12x |
| bench_idle | 12.4 | 9.3 | 1.33x |
| bench_drawcalls | 10.0 | 12.1 | 0.82x |
| bench_instanced | 6.9 | 16.8 | 0.41x |
RAM, MB
Average working-set memory.| Example | rlgl | rlmtl_mesa | rlmtl_mesa speedup |
|---|
| shapes_basic_shapes | 87.4 | 83.8 | 1.04x |
| textures_tiled_drawing | 87.9 | 84.3 | 1.04x |
| textures_particles_blending | 87.7 | 83.9 | 1.05x |
| shapes_starfield_effect | 87.1 | 83.9 | 1.04x |
| models_loading | 103.5 | 99.6 | 1.04x |
| models_heightmap_rendering | 92.8 | 90.1 | 1.03x |
| models_skybox_rendering | 148.0 | 161.9 | 0.91x |
| models_waving_cubes | 87.9 | 100.7 | 0.87x |
| models_first_person_maze | 88.8 | 84.9 | 1.05x |
| core_3d_camera_free | 86.7 | 83.7 | 1.03x |
| shaders_basic_lighting | 94.4 | 102.2 | 0.92x |
| shaders_basic_pbr | 132.9 | 140.8 | 0.94x |
| shaders_mandelbrot_set | 86.6 | 100.8 | 0.86x |
| shaders_raymarching_rendering | 87.3 | 119.1 | 0.73x |
| performance_stress_test | 122.8 | 164.1 | 0.75x |
| performance_stress_test_direct | 86.5 | 102.9 | 0.84x |
| bench_idle | 86.9 | 83.4 | 1.04x |
| bench_drawcalls | 89.5 | 84.8 | 1.06x |
| bench_instanced | 88.3 | 103.9 | 0.85x |
GPU VRAM, MB
Average per-process video memory.| Example | rlgl | rlmtl_mesa | rlmtl_mesa speedup |
|---|
| shapes_basic_shapes | 0.0 | 0.0 | — |
| textures_tiled_drawing | 0.0 | 0.0 | — |
| textures_particles_blending | 0.0 | 0.0 | — |
| shapes_starfield_effect | 0.0 | 0.0 | — |
| models_loading | 0.0 | 0.0 | — |
| models_heightmap_rendering | 0.0 | 0.0 | — |
| models_skybox_rendering | 0.0 | 0.0 | — |
| models_waving_cubes | 0.0 | 0.0 | — |
| models_first_person_maze | 0.0 | 0.0 | — |
| core_3d_camera_free | 0.0 | 0.0 | — |
| shaders_basic_lighting | 0.0 | 0.0 | — |
| shaders_basic_pbr | 0.0 | 0.0 | — |
| shaders_mandelbrot_set | 0.0 | 0.0 | — |
| shaders_raymarching_rendering | 0.0 | 0.0 | — |
| performance_stress_test | 0.0 | 0.0 | — |
| performance_stress_test_direct | 0.0 | 0.0 | — |
| bench_idle | 0.0 | 0.0 | — |
| bench_drawcalls | 0.0 | 0.0 | — |
| bench_instanced | 0.0 | 0.0 | — |