CMake has entered the chat
Over the weekend, I focused on refactoring mat4 and vec3. Additionally, I've made some adjustments to my toolset.
Refactoring and Benchmarking: helios.math.core
I took the time to refactor vec3
and mat4
into helios.math.core
.
By isolating these (and some more) core components, I hope to ensure a more fine grained separation of concerns right from the beginning. I also depend now on Google Benchmark and put mat4
to the test:
Surely, the power house in OpenGL mathematics is GLM (OpenGL Mathematics library), which I frequently use. However, to get a hang of C++ I decided to implement some of the (basic) requirements myself.
Here's a look at the numbers:
In both constructor and multiplication tests, the helios implementation shows a promising performance. Of course I'm nowhere close to the optimizations of glm which sports much, much more functionality than my basic implementations, but its nonetheless nice to see how the two compare.
Benchmarking Guid Pointer To Implementation
Remember my bold claim about theperformance drawbacks of pointer-to-implementation and heap allocation? I’ve put together a benchmark here, comparing the regular and PIMPL versions. As expected, the latter comes with a noticeable performance hit:
Benchmark | Time | Time (CPU) | Iterations |
---|---|---|---|
BM_GuidGenerate | 8.70 ns | 8.40 ns | 83,743,377 |
BM_GuidPimplGenerate | 92.3 ns | 92.7 ns | 7,920,792 |
A New Workflow: CLion and CMake
I’m parting ways with MSVS (for now) in favor of a more automated, cross-platform workflow with CLion and CMake. The goal is to let modern tooling take care of the heavy lifting, especially with dependency management: It turned out that incorporating Google Benchmark was too much of a hassle (for me at last), but CMake did the trick in no time. I also feel pretty much right at home coming from composer, packagist and npm.
It wasn't without its challenges, and I'm still navigating the learning curve, but the potential benefits in productivity and project maintainability are promising.
Join Me on the Journey
I streamed this entire process live on Twitch. If you want to see the code, the benchmarks, and the occasional head-scratching moment as I stumbled through the new CMake setup, you can catch the VOD here.