Analyzer 2.0b for V4

Developed or developing a new product in PureBasic? Tell the world about it.
remi_meier
Enthusiast
Enthusiast
Posts: 468
Joined: Sat Dec 20, 2003 6:19 pm
Location: Switzerland

Analyzer 2.0b for V4

Post by remi_meier »

After everybody knows that I'm interested in optimizing and have announced
the Optimizer, I built today another tool inspired by Intel's VTune!

It's called Analyzer :lol:

Before I forget something:
Download: Analyzer
And take a look at the help file!

So what's its purpose?
It's an IDE plug-in that modifys the PB file compiled with Compile/Run so
that (nearly) every line is tested for its runtime! After you quit your program
there will be an analysis.txt in the source directory which shows you the
time critical lines of code in your code :)

There will be interesting results like:

Code: Select all

Line 71:	Time 10918			StartDrawing(ScreenOutput())
Line 38:	Time 3951			OpenScreen(#SCREEN_WIDTH, #SCREEN_HEIGHT,32,Test)
Line 1:	Time 127			InitSprite()
Line 27:	Time 76			DisplayTransparentSprite(2,newposx,#Posy)
Line 85:	Time 75			Kraftaufwand()
Line 74:	Time 54			DrawText(Kraft  + a$)
Line 69:	Time 46			ClearScreen(125, 125, 125)
Line 88:	Time 30			DisplayTransparentSprite(2,#Posx,#Posy)
Line 89:	Time 11			DisplayTransparentSprite(1,MouseX(),MouseY())
Line 68:	Time 11			FlipBuffers()
So you can concentrate on the real bottlenecks of your program and don't
waste your awfully important time in senseless optimizations :wink:

There are some other possibilities of measure the time with special kinds
of comments, read the help file :P

So have fun and make some great and fast programs!

Source included!


greetz
Remi
Last edited by remi_meier on Sat Feb 04, 2006 4:16 pm, edited 5 times in total.
Athlon64 3700+, 1024MB Ram, Radeon X1600
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

remi_meier strikes back with another hot release! Very nice and usefull tool! Keep on your great work! :D
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Post by Joakim Christiansen »

I always wanted something like this!!! :D
Thank you remi_meier!
I like logic, hence I dislike humans but love computers.
Blade
Enthusiast
Enthusiast
Posts: 362
Joined: Wed Aug 06, 2003 2:49 pm
Location: Venice - Italy, Japan when possible.
Contact:

Post by Blade »

You made a profiler! (this is the official name for this type of utility)

GREAT! :)

added:
The time are cumulative, right?
So if I run the program for 20 seconds or for 30 minutse, the results aren't comparable.
If you count how many time every part is executed, we could know the absolute slowness of every part. (total time/ nr of times)
this makes sense?
remi_meier
Enthusiast
Enthusiast
Posts: 468
Joined: Sat Dec 20, 2003 6:19 pm
Location: Switzerland

Post by remi_meier »

Cool I made a profiler :lol:

@Blade
Yes, the time is cumulative to see how the whole runtime is spread over
the whole code.
> the results aren't comparable.
Right, I didn't think of that... Ok, for the next release there will be also
percentage and number of times called!

Thanks for the feedback!

greetz
Remi

DONE!
Athlon64 3700+, 1024MB Ram, Radeon X1600
Num3
PureBasic Expert
PureBasic Expert
Posts: 2810
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

You're the MAN !!! 8)
remi_meier
Enthusiast
Enthusiast
Posts: 468
Joined: Sat Dec 20, 2003 6:19 pm
Location: Switzerland

Post by remi_meier »

Thx :)

Now I've also added a tool called 'Merger' to the ZIP which can merge all
include files of a whole project into one! It's useful cause the Analyzer
wont modify any include files.
So you can easily merge a whole project into one file and analyze it!

greetz
Remi
Athlon64 3700+, 1024MB Ram, Radeon X1600
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

Wow - this is one NICE tool.
remi_meier
Enthusiast
Enthusiast
Posts: 468
Joined: Sat Dec 20, 2003 6:19 pm
Location: Switzerland

Post by remi_meier »

Sorry!
Thanks to va!n, I could recognize the failures of the Merger!
I've modified a bit..

Lines like
Debug 1 : IncludeFile "xx.pbi"
will now be recognized but 'Debug 1' will be removed! The whole line will
be removed!

In lines like
IncludeFile "xx.pbi" : IncludeFile "yy.pbi"
only the first IncludeXX will be recognized and the whole line will be deleted!

I would be very thankful if somebody would write a better tool, but for me
it stopps here! It should be a help tool for the Analyzer and that's what it
is! I won't write a whole PB parser :lol:

greetz
Remi
Athlon64 3700+, 1024MB Ram, Radeon X1600
SoulReaper
Enthusiast
Enthusiast
Posts: 372
Joined: Sun Apr 03, 2005 2:14 am
Location: England

Post by SoulReaper »

@remi_meier

Thankyou this is real cool, now there is no excuse for me to write slow code :) :roll: :lol: :wink: :D
User avatar
Psychophanta
Addict
Addict
Posts: 4969
Joined: Wed Jun 11, 2003 9:33 pm
Location: Lípetsk, Russian Federation
Contact:

Post by Psychophanta »

Good idea have you had Remi. Thank you.
Now we can say Fred "hey, this command or this other, is too much slow" :D
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB :mrgreen:
remi_meier
Enthusiast
Enthusiast
Posts: 468
Joined: Sat Dec 20, 2003 6:19 pm
Location: Switzerland

Post by remi_meier »

Thx for the nice feedback :)

I have uploaded a new ZIP (200kb) with a better looking help file in PDF
format.

I want your feature requests! Some that are on low priority (cause really
hard to implement):
- CPU Usage (Hard without PBOSL and it surely will add some overhead of
execution time per line!)
- Auto declare loops and procedures as blocks (Cause a procedure can be
left with procedurereturn everywhere in the code, break for loops!)

Is there a 'need' for a GUI which shows you colored the special lines in the
source code and some other cool features? It just would interpret the
analysis.txt and combine it with the real source code! (but a lot of work..)

Are the results realistic and useful? Is there need for a more accurate
Version? (lines like a = b + c will never be really accuratly measured)

At the moment it's open source, if GUI will be added there is surely potential
of a community project. Would that make sense?

greetz
Remi
Athlon64 3700+, 1024MB Ram, Radeon X1600
Brice Manuel

Post by Brice Manuel »

Some people are just too smart for their own good :P Thank you for another great tool :D
thefool
Always Here
Always Here
Posts: 5881
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

Thanks!
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

@remi_meier:
10 points for your great tool! I like your work and this tool! :D
Its cool to see you are inspired by the video i send you 8)
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Post Reply