Our great sponsors
-
OpenRA
Open Source real-time strategy game engine for early Westwood games such as Command & Conquer: Red Alert written in C# using SDL and OpenGL. Runs on Windows, Linux, *BSD and Mac OS X.
-
jumper-py
A python port of Jumper, a pathfinding library designed for grid-based games, originally developed by Yonaba (original repository)
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
Some time ago I contributed to OpenRA. OpenRA is an opensource Real-Time strategy game, and one of the most critical operations in this type of games is pathfinding; it needs to work, and it needs to run fast with lots of units moving at the same time each frame. Therefore, it needs to perform well to offer a nice gaming experience to the player.
I'm gonna use as base the same example over all the profiling executions I'm going to show in this article. In short, this is a unit test from my project jumper-py, and it computes, given a map, the shortest path between two nodes:
PyInstrument, compared to cProfile or Yappi, it's a lot easier to use and requires much less configuration.