ID:2087716
 
(See the best response by Ter13.)
I was reading forum problems and saw that it is possible to see what is taking cpu from your game,how I can do that?

Example that I saw:

Xalexx16 wrote:
>                                   Profile results (total time)
> Proc Name Self CPU Total CPU Real Time Calls
> -------------------------------------------- --------- --------- --------- ---------
> /obj/Items/Den_Den_Mushi/New 0.001 0.010 249.292 48
Best response
Compile in Debug mode.

Build->Preferences->Generate Debugging Information (check the box)

When running your world in DS: right click on the title bar. Server->Profile. Click start. Refresh to update the list.

When running your world in DD: click on server->profile. Same deal.

Self CPU is how long the proc itself took in seconds.

Total CPU is how long the proc and all calls initiated from that proc took in seconds.

Real Time is when the proc ended minus when the proc started in real time seconds.

Calls is the number of times that the function has been called while you are profiling.


The profiler only catches information from functions called after you start profiling. You can reboot the world after starting the profiler to catch what happens on startup.

The average button averages the self, total, and real time by the number of calls.

For optimization, you are going to want to look mostly at Self CPU. Start with your highest self CPU average and work your way down the list, improving your code where you can. Once you start getting to 0.000 averages, you are going to want to start looking at non-averaged self-cpu and work on your biggest impact functions, working your way down again.

Dream Daemon also lets you look at memory and instance information in the memory profiler.

Both let you look at network bandwidth for connected players.

This information is very useful. Good luck. Don't bother with optimization until you need to or you are getting to the polish phase. Early optimization kills projects. Better to learn good habits in the first place, but just doing what you can and not stressing about the optimization until you run yourself into problems is good too. Worst is stressing over tiny details and never making any progress.
Oh,thank you! It will be a lot helpfull for future AI tests.