Page 1 of 6

Analyzer 2.0b for V4

Posted: Thu Oct 13, 2005 10:33 pm
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

Posted: Thu Oct 13, 2005 10:36 pm
by va!n
remi_meier strikes back with another hot release! Very nice and usefull tool! Keep on your great work! :D

Posted: Thu Oct 13, 2005 11:10 pm
by Joakim Christiansen
I always wanted something like this!!! :D
Thank you remi_meier!

Posted: Thu Oct 13, 2005 11:35 pm
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?

Posted: Fri Oct 14, 2005 10:15 am
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!

Posted: Fri Oct 14, 2005 11:13 am
by Num3
You're the MAN !!! 8)

Posted: Fri Oct 14, 2005 11:49 am
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

Posted: Fri Oct 14, 2005 1:23 pm
by rsts
Wow - this is one NICE tool.

Posted: Fri Oct 14, 2005 3:56 pm
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

Posted: Fri Oct 14, 2005 8:12 pm
by SoulReaper
@remi_meier

Thankyou this is real cool, now there is no excuse for me to write slow code :) :roll: :lol: :wink: :D

Posted: Fri Oct 14, 2005 10:07 pm
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

Posted: Fri Oct 14, 2005 10:48 pm
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

Posted: Fri Oct 14, 2005 10:50 pm
by Brice Manuel
Some people are just too smart for their own good :P Thank you for another great tool :D

Posted: Fri Oct 14, 2005 11:03 pm
by thefool
Thanks!

Posted: Sat Oct 15, 2005 12:07 am
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)