ioquake / ioq3

The ioquake3 community effort to continue supporting/developing id's Quake III Arena
https://www.ioquake3.org/
GNU General Public License v2.0
2.34k stars 522 forks source link

CPU usage benchmark #609

Closed zamazan4ik closed 11 months ago

zamazan4ik commented 11 months ago

Hi!

I am trying to evaluate Profile-Guided Optimization (PGO) benefits for the game domain, so I built ioq3 with Clang's PGO. But the main question - is there a way to somehow bench the game? Especially, I am interested in benchmarking CPU usage.

If you have ideas, on how it's possible to do this - please let me know. Maybe some ready-to-use bench suites/scenarios/tools/a piece of advice - anything would be helpful.

Thanks in advance.

NuclearMonster commented 11 months ago

If you have a copy of quake 3 arena you can run the game and there is a default demo included with it that can function as a benchmark or you can record your own. It is easily repeatable and you can even launch it from the command line. With something like +demo demofile

You can also issue those commands using the console in game (bring it down with the key to the left of the 1 key or shift+escape) like: /demo play a demo /record record a demo /stopdemo stop recording the demo

All of these can also be bound to in-game keys.

Two things of note: 1) A demo is the term from the time this game was made for recording gameplay in a replayable format. Before there was YouTube and other video hosting services, you could record a demo and others could play it back and see what happened in a match of quake 3.

2) The CPU usage of ioquake3 is largely trivial at this point. While I'm sure someone could optimize more for today's processors and attempt to split the load from the single threaded era, it's almost pointless to work on. Not that someone shouldn't, because you can always have fun working on quake 3 and add more to fill or raise up that performance and match modern processors, but that from a performance perspective is just how it is at present.

Good luck and let us know on our forums if you run into any trouble or just want to discuss it further: https://discourse.ioquake.org/

zamazan4ik commented 11 months ago

Thanks for the suggestion!

it's almost pointless to work on

Completely agree. I decided to test PGO on Quake 3 because:

  1. I want to test PGO for games. But finding an open-source game is not a trivial task. If you have a better example of a more CPU-heavy open-source game - would be nice to check it too.
  2. "Just for lulz" :)

If I'll see more questions regarding the topic, I'll create an issue on the Discourse forum.

Calinou commented 11 months ago

I want to test PGO for games. But finding an open-source game is not a trivial task. If you have a better example of a more CPU-heavy open-source game - would be nice to check it too.

Minetest probably fits the bill. Servers with dozens of mods in particular can be quite taxing on the CPU, both for the server itself but also for clients (when in large city spawns).

zamazan4ik commented 11 months ago

Yeah - seems like exactly what I need! Definitely will try Minetest as well. Thanks a lot for the idea!

But I will try it only after playing with Quake3d - it's quite funny to compile and play with a game from my childhood ;)