Getting resource usage in release builds

is there a way to get CPU/RAM usage in release builds?
the API reference says enabling ‘track_cpu’ in the game.project allows you to get the CPU values in release builds, but attempting to call the ‘profiler.get_cpu_usage()’ function to get the CPU use only results in an error because the profiler is nil.
is there a separate function to do this other than a profiler function?

This really depends on the platform you are running on. There’s usually very powerful platform specific tools to measure resource usage. Android Studio for Android builds, XCode Instruments for iOS and macOS and so on.

Which platform are you testing on? And are you using a release or debug build? Or are you using an app manifest to strip out the profiler?

Which platform are you testing on? And are you using a release or debug build?

i’m running it on linux, using a release build whenever i bundle the program
i don’t actually know what an app manifest is, so i don’t think that is the problem

There’s usually very powerful platform specific tools to measure resource usage.

i would really rather not rely on platform specific tools, as i build for windows and linux, and having to keep track of all of it would make debugging harder - especially considering that i have a hard time understanding my own code, let alone external libraries.

i know that the Lua garbage collector has a function to get the memory use, but i don’t know if that applies to the whole engine’s memory use.

Hi @CrazyAmphibian !

I’d like to point out that we make very little difference between debug and release.
They’re built with the same flags, so performance is the same.
The final build differs in that the logging is turnmed off as well as the “engine service” which let you do hot reload.

So, depending on what you want to measure, using the profiler in a debug build should most likely work well for you.

@Mathias_Westerdahl just measure memory usage and cpu usage (more priority on memory use rather than CPU)

should i just be using debug builds instead of release builds?

Yes.
As I mentioned, they’re mostly the same.
Apart from debugging services being disabled (logging, profiling, hot reload etc)

when would one want to do a release build as opposed to a debug build?

The release builds are for when you finally ship the game.
E.g. removing ssdp requests and logging etc can be good to be compliant with the platform you target.