Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Particle Simulator

A toy particle simulator supporting gravity, charges & springs · By lisyarus

Manually compiled version slower than pre-compiled binaries

A topic by RottenLynx created Mar 01, 2023 Views: 153 Replies: 1
Viewing posts 1 to 2

I was peeking at the source code of the simulator and decided to clone the repo to play around with the code. I built and compiled the game without modifying any of the source code and noticed that it ran considerably slower than in the pre-compiled binaries that i downloaded here. I also noticed that the game's responsiveness remained the same, clicking around and playing with the GUI felt smoother than watching the simulation and moving the camera around was also smooth. So i'm wondering if maybe the game intentionally slows down the simulation speed when it becomes intensive? I'm clueless as to why manually compiling the source code would result in a seemingly slower game, it could also be compiler optimizations but then again, the GUI and camera aren't really affected and feel smooth but the simulation speed is drastically different.

Developer

That’s interesting! The simulation happens in a background thread (or threads), so the GUI and camera should always be smooth, that’s working as designed. If you’ve built the project via CMake with Release build type (CMAKE_BUILD_TYPE=Release), the build options (e.g. optimization level) should’ve remained the same. Otherwise, CMake might have selected a default non-release build type, which will be slower.

Another cause might be the compiler. I’m using MinGW 10 to compile Windows binaries, and using a different compiler (e.g. Visual studio) might explain the slowdown.