Allow developers to read CPU and GPU frametimes

Title says all, I would like to be able to read how many ms the CPU and GPU take to calculate new frames. This would allow me to adjust my game’s CPU and GPU loads respectively based on the figures I measure. I believe there is already some internal API for this (since you can see those stats in Performance Stats).

Use cases:

  1. Scale up game demands if a client is running at a locked 60fps but actually has more headroom (any frametime under 16.6ms is obviously going to be capped at 16.6, unless you use rbxfpsunlocker. So measuring frametime with heartbeat or whatever isn’t the best representation of system performance and prevents even higher levels of fidelity being automatically scaled by the dev - for example drawing 1000 NPCs on screen in a city, rather than just 100.)
  2. Allow us to scale our own systems based on GPU loads. For example, if you have a custom LOD system, you could LOD more or less aggressively based on GPU frametime. Currently, if you were to measure heartbeat and use that to scale visual load, if the client were CPU bottlenecked, the visuals would also suffer.

On another note, it would be very helpful if we could see not just how much memory is being allocated, but also how much memory is available to the Roblox app. I know Roblox likes to manage everything themselves for a “streamlined developer experience” or whatever, but a lot of devs are making their own systems these days and there is no harm in having an obscure API lying around that advanced devs could use. Devs should be trusted with more information.

47 Likes