Skip to content
This repository has been archived by the owner on Jan 6, 2024. It is now read-only.

Suppport for gamemode on Linux #37

Open
stephanlachnit opened this issue May 26, 2020 · 7 comments
Open

Suppport for gamemode on Linux #37

stephanlachnit opened this issue May 26, 2020 · 7 comments

Comments

@stephanlachnit
Copy link

It would be cool if Tomatenquark could add support for gamemode. Basically what it does it changing the CPU gov for the game (and some other performance tricks), and resetting it afterwards, so it should increase performance a bit for some users.
It can be integrated in three ways:

  1. Include a header in the main function
  2. Statically link libgamemodeauto (basically the same as 1.)
  3. Dynamically link libgamemodeauto

Since Make isn't exactly very flexible when it comes to build options (it's possible but ugly), I would wait for #22 to be resolved.
In Meson, it would be quite simple to give all these three options. At least having both 1. and 3. is nice because that means that one can simply add it for a Steam build without worrying if gamemode is installed, but also Distro shipping Tomatenquark (maybe I'll go for it in Debian if I find the time) can simply link against the system installation of libgamemodeauto.

@Calinou
Copy link
Contributor

Calinou commented May 26, 2020

Considering Tomatenquark's low system requirements, would enabling GameMode help meaningfully? I guess it doesn't hurt to do it, but we should weigh in the maintenance cost of integrating GameMode.

@stephanlachnit
Copy link
Author

Considering Tomatenquark's low system requirements, would enabling GameMode help meaningfully? I guess it doesn't hurt to do it, but we should weigh in the maintenance cost of integrating GameMode.

I don't think it would make a huge difference, but the client integration is really really simple and failsafe (tries to load gamemode if installed on the system, else it does nothing). It's possible to do it in two lines:

#define GAMEMODE_AUTO
#include "gamemode_client.h"

With a build option that would extend to

#ifdef USE_GAMEMODE
#define GAMEMODE_AUTO
#include "gamemode_client.h"
#endif

@Fohlen
Copy link
Contributor

Fohlen commented May 26, 2020

I'd say, given #22 would be merged, I don't see why we should not go for it.

@Fohlen
Copy link
Contributor

Fohlen commented Jun 2, 2020

@stephanlachnit with #40 becoming merged would you like to do the following:

  • create a vcpkg port for gamemode
  • add a PR for linux using this

All the best

@stephanlachnit
Copy link
Author

create a vcpkg port for gamemode

I don't think that is necessary, but maybe I'll look into adding a build option. After all, it's literally just one header and four lines.

@Fohlen
Copy link
Contributor

Fohlen commented Aug 3, 2020

@stephanlachnit I do not like including "just one header". It becomes messy quickly. If gamemode uses CMake we can also use the FetchContent module like so: https://github.com/tomatenquark/code/blob/master/CMakeLists.txt#L71.
Anyways. Could you create a PR for this?

@stephanlachnit
Copy link
Author

I'm sorry right now I don't really have time for this

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants