How to profiler

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By PerduGames
:warning: Old Version Published before Godot 3 was released.

I do not understand everything the profiller can offer.

could someone explain the basics to me?

:bust_in_silhouette: Reply From: wombatstampede

I guess you’re talking about the current stable version of godot (2.1.4).

The profiler (+the other tabs like “Monitor”) helps to identify actual or potential performance problems in your application.

You’ll start it while the app is running and you can select different topic which can be added to the graph.

You’ll see the frame rate and also how much cpu physics or script functions use depending on the current state of the game. You can also do changes in the node tree of scene files and watch the performance changes. I.e. you can hide certain groups/nodes and watch if there’s an impact on the frame rate.

If you develop for android, you can also link the device via usb & network, set up the editor and can then do the same on a mobile device (profiler node-tree on pc, while the app is running on the mobile device). It sometimes helps to not debug on the best performing device :slight_smile:

Remote debugging/profiling may not be the simplest to set up but is extremely helpful+comfortable if it works. It helped me to identify some performance problems caused by 3d physics (custom 3d collision meshes vs. 3d areas caused some performance hits).

I’m using 3.0, is it different? how do I measure the time a code spends to be paid using the profiller?

PerduGames | 2017-09-12 23:00

I think it is similar in 3.0. (Didn’t check the android profiling, yet).

As far as I know the profiler isn’t directly comparable to standard-profilers which usually run and then give you i.e. a summed up execution time per function at the end.

Instead it shows the values & graphs of certain run times in real time. If the app runs, you should be able to see (& select for graphing) the execution time/frame + numer of calls / frame of individual functions below “Script Functions”.

Additionally to the script function performance it’ll also give you the run times for i.e. physics and other time-eaters of the game. :wink:

wombatstampede | 2017-09-15 10:24

@wombatstampede custom 3d collision meshes vs. 3d areas What is faster? Can you explain please?

vctr | 2017-12-25 14:04

What I wanted to say is that I experienced severe performance problems when PhysicBodies with custom collision shapes collided with Areas which had simple boxshape collision shapes.

So for example I had an player controlled object (RigidBody) with a custom collision shape (two cylinders with 32 faces each). When this object entered an Area then the CPU usage went up. Even when the area was disabled.

So I would suggest (at least for Godot 2.1.4) that you don’t use custom collision shapes for player controlled objects if possible. Instead try to compose it of standard collision shapes (if a single standard collision shape doesn’t fit).

Also, physics don’t work well with custom collision objects. Godot 2.1.4 doesn’t calculate inertia for custom shapes. And refrain from scaling collision shapes. This gave me all kind of strange results. Edit their extents instead.

wombatstampede | 2017-12-26 09:56

:bust_in_silhouette: Reply From: ProggerParrot

I know the answer come a little late. But the profiler in Godot is quite powerful, and this video will definitely helps you.