.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > General Bot Coding
General Bot Coding See what a pain it is to get those little mechs shooting around

Reply
 
Thread Tools
Question on code profiling
Old
  (#1)
cruft
Guest
 
Status:
Posts: n/a
Default Question on code profiling - 20-01-2004

So what do you guys use to profile your code? Something open source or off the shelf? Rolled your own?

Just curious about other people's personal experience and what has worked for them.
  
Reply With Quote
Re: Question on code profiling
Old
  (#2)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Question on code profiling - 20-01-2004

What do I use to profile my code ?
my nose

Seriously, I don't profile at all. That's a bad habit I know, but I never managed to understand how it worked with MSVC and I'm too lazy -or perhaps too many other things to do- to figure it out

Aspirin has written a REALLY KICKASS profiler class for his JoeBot XP, he sent it to me once ago but I don't know if he considers it open source or not and I'm not sure he would authorize me to post it here... better ask him But wait, when I mean really kickass, it's really WHIPPING!!



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Question on code profiling
Old
  (#3)
botman
Super Moderator
 
Status: Offline
Posts: 280
Join Date: Jan 2004
Location: Plano, TX
Default Re: Question on code profiling - 20-01-2004

The Half-Life SDK comes with a "Profile" build option, but I've never managed to get it to work properly. Other people on the Wavelength forum have reported to have gotten the profile build to run and generate profile information, so you might try posting a message in the Coders forum on thewavelength.net

botman
  
Reply With Quote
Re: Question on code profiling
Old
  (#4)
@$3.1415rin
Council Member, Author of JoeBOT
 
@$3.1415rin's Avatar
 
Status: Offline
Posts: 1,381
Join Date: Nov 2003
Location: Germany
Default Re: Question on code profiling - 20-01-2004

no problem with publishing that code ... although there is no nice doc yet

last weekend I worked on gcc compatability, therefore some stuff isnt funny debugged yet, especially CTime::CPUSpeed::getCyclesDifference.
Recording maximum and minimum cpu usage was once a feature but I had to remove it due to restructuring the code ... maybe that's something for the next weekend after the exams

this code has only be tested on a p4 2.66 and a Athlon1Ghz.

and pierre, I think the nose is the best method to profile, although you can use the debugger sometimes as a debugger, that's interesting too
Attached Files
File Type: cpp HPTime.cpp (4.8 KB, 419 views)
File Type: h HPTime.h (2.1 KB, 412 views)
File Type: cpp Profiler.cpp (7.6 KB, 521 views)
File Type: h Profiler.h (3.0 KB, 400 views)



Last edited by @$3.1415rin; 29-03-2004 at 18:56..
  
Reply With Quote
Re: Question on code profiling
Old
  (#5)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Question on code profiling - 20-01-2004

Joe, you should attach a screenshot of how this profiler looks like in the game...



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Question on code profiling
Old
  (#6)
@$3.1415rin
Council Member, Author of JoeBOT
 
@$3.1415rin's Avatar
 
Status: Offline
Posts: 1,381
Join Date: Nov 2003
Location: Germany
Default Re: Question on code profiling - 20-01-2004

ok, this is how it currently looks like ... I really gotta readd that maximum and minimum stuff again


The first line shows where we are in the tree and what's the current percentage of the stuff that is shown ... all % values below are then relative to this. Below we can see which functions are called. if a + is in front of it, we can go there with the cursor and browse deeper to the tree ... ( the cursor is the ------- line )



Last edited by @$3.1415rin; 20-01-2004 at 22:44..
  
Reply With Quote
Re: Question on code profiling
Old
  (#7)
koraX
Member
 
koraX's Avatar
 
Status: Offline
Posts: 145
Join Date: Jan 2004
Location: Slovak Republic
Default Re: Question on code profiling - 21-01-2004

uhm what is profiler ?


kXBot
koraX's utils
- see my homepage for other projects (OpenGL CSG Editor, FAT16 Sim, NNetwork Sim, ...)
  
Reply With Quote
Re: Question on code profiling
Old
  (#8)
botman
Super Moderator
 
Status: Offline
Posts: 280
Join Date: Jan 2004
Location: Plano, TX
Default Re: Question on code profiling - 21-01-2004

A profiler tells you how much CPU time is being spent inside each function so you can re-write all the code that's really slow to make things run faster.

botman
  
Reply With Quote
Re: Question on code profiling
Old
  (#9)
@$3.1415rin
Council Member, Author of JoeBOT
 
@$3.1415rin's Avatar
 
Status: Offline
Posts: 1,381
Join Date: Nov 2003
Location: Germany
Default Re: Question on code profiling - 29-03-2004

I updated the Profiler.cpp and .h a little, now you'll also be shown a factor how much lower the minimum/maximum timespan spent there was.


  
Reply With Quote
Re: Question on code profiling
Old
  (#10)
@$3.1415rin
Council Member, Author of JoeBOT
 
@$3.1415rin's Avatar
 
Status: Offline
Posts: 1,381
Join Date: Nov 2003
Location: Germany
Default Re: Question on code profiling - 30-03-2004

currently writing some little file output functions ... doesnt even produce significant lags on my old pc here - celeron 466

here a preview ( it's the data from one round CS ) : http://joebot.bots-united.org/joebotxp/test.html


  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com