In this project, we’re doing some JavaScript optimization. This is a follow-up to our last project that covered spatial hash grids, or spatial hashing as it’s sometimes referred to. Anyway, we’re continuing and building on that JavaScript spatial hash grid implementation, but we’ll be examining it in detail with Chrome’s DevTools profiler, looking for hotspots and optimization opportunities. I’ll take you step by step through the process, benchmarking the code, examining the profile, and ultimately making the existing implementation dramatically faster.

Whether you’re a game developer interested in this specific spatial hash grid data structure, or a JavaScript developer looking to work on your optimization skills, this has a lot to offer.

Understanding datastructures, having a complete and thorough basis with them is a key skill for any game developer. It’s a complex field with tradeoffs between memory, time complexity, and even development and maintenance cost all come into play. Understanding how to look at code, profile, optimize, and in short speed it up are import skills for a developer.

In the video, we cover:

  • Looking at the overall optimization strategy, how to approach a chunk of code for improvement.
  • Profiling & Optimization in Chrome, using the built-in DevTools to capture profiling data and examine it.
  • Walking through the sources tab to look at line-by-line hotspots in JavaScript code.
  • Weighing datastructure options, discussing the tradeoffs between Set containers, Map containers, arrays, and linked lists.
  • Actually making the JavaScript code optimized.




How to Optimize My JavaScript Project (Full Guide) | Faster Spatial Hash Grids
57.85 GEEK