Low Level Platform Optimisation

The Video

The Explanation

This is a low-level memory tracking and allocation program, which was also ported to the PS5. It focuses on optimisation of basic physics resolution via spatial partitioning, safe threading, and cache reuse. I also used it for experimentation between different pooling methods, heap walking, and iterating through the use of profiling tools.

Features:

  • Job-based threading
  • Memory tracking, pooling, and corruption detection
  • Hybrid allocation (per-frame vs permanent pools)
  • Cache-friendly data layouts and access patterns

Project Analysis and Conclusion:

This project was extremely useful for learning and applying optimisation techniques that are hard to experiment with in large codebases. It helped me understand memory management, caching, spatial partitioning, threading, and how manual allocation and data locality can significantly reduce cache misses and improve performance.

I’m particularly happy with the gridding system, where cells manage object movement themselves instead of reassigning all objects every frame, avoiding a costly full iteration. While this requires mutex locking due to threading, the overhead is outweighed by the saved work, and I avoided more complex structures like quadtrees due to their dynamic nature and poor thread workload predictability.

The pooling system works but isn’t designed as cleanly as I’d like, with objects requesting pool access themselves and falling back to heap allocation when needed. A better approach would be allocating from the pool first and passing that memory into object construction, while also unifying memory tracking and reducing the maintenance burden between debug and release builds.

Performance-wise, the final version with 5000 objects is faster than the original with only 100, showing massive non-linear gains from optimisation and parallelism. While results depend on the number of objects and threads, comparisons show reductions down to 0.2–5.4% of the original update time, with release builds reducing the frame time even further, making the project a clear success.