raylib performance — backend comparison

rlvk (moltenvk)  vs  rlvk (kosmickrisp)  vs  rlgl  |  GPU Apple M5 (24576 MB)  |  Driver MoltenVK 1.4.2  |  OS macOS 26.5.1  |  3 runs × 10000 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. On macOS, Metal-backed Vulkan presents pace on drawable acquire (~1.6-1.8 ms) while GL's IOSurface flush has no floor - only rows without ° compare backend rendering cost.

Read this before comparing FPS on macOS. Uncapped FPS on light scenes here measures presentation, not rendering. Apple GL presents by flushing an IOSurface — no per-frame handshake, essentially free — while Vulkan on macOS (MoltenVK or KosmicKrisp) can only present through Metal, which must acquire a CAMetalDrawable from CoreAnimation each frame, paced at ~1.6–1.8 ms on a composited window no matter how little the frame draws. Measured on shapes_basic_shapes, uncapped: frame interval avg 1.95 ms, of which 1.76 ms (90%) is "Retrieve a CAMetalDrawable" (MoltenVK's own performance tracking; the drawing itself costs ~0.12 ms and the GPU is nearly idle). Every native Metal app pays the same pacing; no driver knob removes it (KosmicKrisp's is lowered from ~3.3 to ~1.6 ms by MESA_VK_WSI_PRESENT_MODE=mailbox, MoltenVK's config surface is exhausted). Cells marked ° sit at that backend's floor: their cross-backend ratios compare macOS present plumbing. Rows above the floor compare real rendering — there the Vulkan backend leads (e.g. 8000 draw calls: 120 fps GL vs 581 fps rlvk). Under vsync all backends lock to the display rate and the floor is invisible.

Frames per second (higher is better)

Sustained FPS at full speed (uncapped).
Examplerlvk (moltenvk)rlvk (kosmickrisp)rlgl
shapes_basic_shapes516°598°8151°
textures_tiled_drawing472°572°8043°
textures_particles_blending532°599°7572°
shapes_starfield_effect529°599°7833°
models_loading289565°2416
models_heightmap_rendering559°466°2240
models_skybox_rendering331599°2485
models_waving_cubes544°599°384
models_first_person_maze309564°8299°
core_3d_camera_free353564°2440
shaders_basic_lighting512°569°4151
shaders_basic_pbr2823663915
shaders_mandelbrot_set412°535°1146
shaders_raymarching_rendering156250311
performance_stress_test19514681
performance_stress_test_direct344
bench_idle415°570°6256°
bench_drawcalls474°552°120
bench_instanced362496°691

Median frame time, ms (lower is better)

Median per-frame CPU wall time.
Examplerlvk (moltenvk)rlvk (kosmickrisp)rlgl
shapes_basic_shapes1.601°1.597°0.117°
textures_tiled_drawing1.616°1.599°0.118°
textures_particles_blending1.603°1.597°0.124°
shapes_starfield_effect1.603°1.597°0.122°
models_loading3.3691.598°0.386
models_heightmap_rendering1.684°1.615°0.406
models_skybox_rendering3.0441.597°0.374
models_waving_cubes1.657°1.597°2.485
models_first_person_maze3.2911.599°0.111°
core_3d_camera_free2.9311.599°0.381
shaders_basic_lighting1.606°1.598°0.229
shaders_basic_pbr3.4052.6680.245
shaders_mandelbrot_set1.888°1.604°0.826
shaders_raymarching_rendering3.6563.7843.421
performance_stress_test5.1016.87412.083
performance_stress_test_direct325.523236.272242.120
bench_idle1.840°1.612°0.130°
bench_drawcalls1.835°1.635°7.894
bench_instanced2.4721.814°0.990

Average frame time, ms (lower is better)

Mean per-frame wall time.
Examplerlvk (moltenvk)rlvk (kosmickrisp)rlgl
shapes_basic_shapes1.939°1.672°0.123°
textures_tiled_drawing2.119°1.749°0.124°
textures_particles_blending1.881°1.670°0.132°
shapes_starfield_effect1.892°1.670°0.128°
models_loading3.4641.771°0.414
models_heightmap_rendering1.790°2.147°0.446
models_skybox_rendering3.0181.669°0.402
models_waving_cubes1.837°1.669°2.601
models_first_person_maze3.2331.775°0.120°
core_3d_camera_free2.8331.772°0.410
shaders_basic_lighting1.951°1.757°0.241
shaders_basic_pbr3.5522.7330.255
shaders_mandelbrot_set2.430°1.870°0.873
shaders_raymarching_rendering6.4133.9963.212
performance_stress_test5.1236.86712.412
performance_stress_test_direct329.243236.202241.852
bench_idle2.408°1.754°0.160°
bench_drawcalls2.111°1.811°8.354
bench_instanced2.7662.017°1.448

CPU utilization, %

Average process CPU as percent of the whole machine.
Examplerlvk (moltenvk)rlvk (kosmickrisp)rlgl
shapes_basic_shapes3.93.212.9
textures_tiled_drawing3.53.212.9
textures_particles_blending4.23.212.0
shapes_starfield_effect4.13.212.9
models_loading1.93.15.4
models_heightmap_rendering4.42.94.9
models_skybox_rendering2.13.15.5
models_waving_cubes7.69.07.1
models_first_person_maze2.03.112.5
core_3d_camera_free2.33.15.5
shaders_basic_lighting4.33.912.1
shaders_basic_pbr2.13.312.4
shaders_mandelbrot_set3.24.13.8
shaders_raymarching_rendering1.30.51.0
performance_stress_test10.310.49.8
performance_stress_test_direct0.00.00.0
bench_idle2.94.49.1
bench_drawcalls7.78.29.9
bench_instanced3.13.92.4

RAM, MB

Average working-set memory.
Examplerlvk (moltenvk)rlvk (kosmickrisp)rlgl
shapes_basic_shapes85.493.487.0
textures_tiled_drawing85.793.687.3
textures_particles_blending85.593.587.2
shapes_starfield_effect85.393.486.9
models_loading101.2108.4103.1
models_heightmap_rendering88.795.792.6
models_skybox_rendering161.7169.9147.6
models_waving_cubes92.8100.987.8
models_first_person_maze86.394.088.5
core_3d_camera_free85.293.286.2
shaders_basic_lighting102.4111.697.2
shaders_basic_pbr140.7148.4129.5
shaders_mandelbrot_set103.6111.586.1
shaders_raymarching_rendering118.9126.386.4
performance_stress_test152.8199.4122.8
performance_stress_test_direct104.0111.186.4
bench_idle84.993.186.5
bench_drawcalls86.594.793.0
bench_instanced103.6111.687.3

GPU VRAM, MB

Average per-process video memory.
Examplerlvk (moltenvk)rlvk (kosmickrisp)rlgl
shapes_basic_shapes0.00.00.0
textures_tiled_drawing0.00.00.0
textures_particles_blending0.00.00.0
shapes_starfield_effect0.00.00.0
models_loading0.00.00.0
models_heightmap_rendering0.00.00.0
models_skybox_rendering0.00.00.0
models_waving_cubes0.00.00.0
models_first_person_maze0.00.00.0
core_3d_camera_free0.00.00.0
shaders_basic_lighting0.00.00.0
shaders_basic_pbr0.00.00.0
shaders_mandelbrot_set0.00.00.0
shaders_raymarching_rendering0.00.00.0
performance_stress_test0.00.00.0
performance_stress_test_direct0.00.00.0
bench_idle0.00.00.0
bench_drawcalls0.00.00.0
bench_instanced0.00.00.0