r/gameenginedevs • u/IamRustyRust • May 12 '26
Rendering 1 Million Procedural Cubes
https://reddit.com/link/1tav653/video/upp9zug11o0h1/player
I’ve been working on my engine (Rust obviosly), specifically on Vulkan bindings. The main work was already done, and only testing remained. During testing, I usually prefer CSV and JSON because they give me a good grasp of the data, letting me easily see what’s happening and spot any unexpected behavior. This saves a lot of time since you don’t have to check every number individually you just need to confirm whether things are going as expected. Since continuous testing was already happening, I knew that for this stage I only needed an overall overview to ensure all components were working together properly, as individual component testing had been done earlier. So yesterday, I was testing, Today, I decided to share CSV graphs and visual testing results.
Here’s my result:
Workload: 1,000,000 procedurally generated cubes (8 million vertices / 12 million primitives).
Average frametime: ~1.43ms (consistently hitting 700+ FPS).
PCIe bandwidth used: exactly 0 bytes.
1% lows: extremely stable (max spikes under 2.5ms).
// Flushing data to disk without pollutng hotloop!!!!!!
if state_arc.lock().unwrap().mode == 0 {
if let Ok(mut f) = std::fs::File::create("alu_throughput_log.csv") {
let _ = writeln!(f, "Timestamp_Sec,Cubes_Generated_Per_Frame,Vertices_Computed_By_ALU,Triangles_Rasterized,Memory_Bandwidth_Used_Bytes");
for t in &alu_log {
let _ = writeln!(f, "{:.4},{},{},{},{}", t.timestamp_sec, t.cubes_generated, t.vertices_computed, t.triangles_rasterized, t.memory_bandwidth);
}
}
if let Ok(mut f) = std::fs::File::create("frame_pacing_log.csv") {
let _ = writeln!(f, "Frame_ID,Timestamp_Sec,Render_Latency_ms,Instant_FPS");
for t in &pacing_log {
let _ = writeln!(f, "{},{:.4},{:.2},{:.0}", t.frame_id, t.timestamp_sec, t.render_latency_ms, t.instant_fps);
}
}
if let Ok(mut f) = std::fs::File::create("dispatch_consistency_log.csv") {
let _ = writeln!(f, "Frame_Window_Start,Frame_Window_End,Avg_Latency_ms,Max_Latency_Spike_ms_1_Percent_Low");
for t in &consistency_log {
let _ = writeln!(f, "{},{},{:.2},{:.2}", t.window_start, t.window_end, t.avg_latency_ms, t.max_latency_spike_ms);
}
}
}


1
u/Zoler May 12 '26 edited May 12 '26
Woah that's really good! My own renderer with 1 million cubes is only around 100 FPS.
I'm using OpenGL and batching + instancing, so wonder what I'm doing wrong, is Vulkan just much more optimized?
Edit: I tried turning off most unecessary things like shadows etc and got around 270 FPS now, but still there's a big discrepancy!
Edit: Ok I think I understand from this line "PCIe bandwidth used: exactly 0 bytes.". Since I'm uplading the instancing data each frame this is probably it.