Themabewertung:
  • 0 Bewertung(en) - 0 im Durchschnitt
  • 1
  • 2
  • 3
  • 4
  • 5
Blitz Profiler v1.0
#1
Big Grin 
Ohje, ich hab endlich wieder ein Projekt fertig! Cool 

Und zwar hatte ich mal letztes Jahr in einem Forum einen PROFILER für Blitzbasic2 angedeutet. Der war im Prinzip damals schon fertig, ich mußte nur noch die Zeitmessung dazubauen. Da half mir dann noname/haujobb aus.

Wieauchimmer, ich habe es jetzt (mit den gegenwärtigen Spezifikationen) fertig.

Über die Distribution muß ich noch nachdenken, ist ja kein OpenSource aber kosten soll es natürlich auch nix.
Vielleicht ein Precompile-Include oder so.

Was tut es?

Es stellt einfache Methoden zur Verfügung, benutzte Prozeduren zu zählen und die darin verbrachte Zeit zu messen.
(man muß natürlich die für das Profiling selbst benutzte Zeit im Auge behalten).

Dafür fügt man in jede zu überwachende Prozedur einen "Entry" und am Ende einen "Exit" Aufruf ein.

Am Ende kann man (bisher) ein paar Statistiken ausgeben:

   

Schaut mal unten auf das Beispiel, das ist kurz und verständlich.

Da ist natürlich eine GUI geplant, und statistische Auswertungen und und und.

Ist vielleicht ganz sinnvoll?


Code:
;
;test of stat/debug/ profiler possibilities
;
;by frank b., germany
;
;the symbols have obscure names to not interfere
;  with others, as this is supposed to be "invisible",
;  like an include or something
;
;todo: add timer stuff to really measure somethin
;      add memdump/save instead of array()
;      add gui
;history
;      done timing support
;      seems like we are shipping this version!
;      08.DEC.2019

INCDIR  "BlitzINC:src/"
XINCLUDE"profiler_v06.bb"

;#############################################################

;CONTENS


;#bb__profilerON  =1    ;0=OFF

;#bb__PRO_maxfuncs=100

;Macro bbPRO_EntryFunc  ; {uniqueidname, display name of func}
;Macro bbPRO_ExitFunc

;Macro ProfilerStatsCLI

;including timer
;Macro bbPRO_EntryFuncT ; {uniqueidname, display name of func}
;Macro bbPRO_ExitFuncT
;

;#############################################################

.setup


#bb__profilerON = 1
.
.Test_Case


._testfunc
Statement testfunc1 {}

!bbPRO_EntryFuncT{tfunc1,"STAT: testfunc1"}

;---this is the original funcs routine--------------
NOP
Delay_5
;---------------------------------------------------

!bbPRO_ExitFuncT
End Statement

Statement testfunc2 {}

!bbPRO_EntryFuncT{tfunc2,"STAT: testfunc2"}

;---this is the original funcs routine--------------
NOP
Delay_5
;---------------------------------------------------

!bbPRO_ExitFuncT
End Statement


.main
CNIF #bb__profilerON
  bb_pro_starttimer{}
CEND

For a=1 To 5         ;runs our testfunction 5 times
  testfunc1{}
Next a

testfunc2{}          ;runs only one time

CNIF #bb__profilerON

!ProfilerStatsCLI    ;put out statistics

; For a=1To 10

;  NPrint "Time out:", bb_pro_gettime{}
;  Delay_5

; Next

CEND

NPrint "click mouse"

MouseWait
Zitieren


Nachrichten in diesem Thema
Blitz Profiler v1.0 - von hackball - 08.12.2019, 20:07
RE: Blitz Profiler v1.0 - von asrael - 09.12.2019, 09:02
RE: Blitz Profiler v1.0 - von hackball - 09.12.2019, 19:06
RE: Blitz Profiler v1.0 - von hackball - 13.12.2019, 17:11

Gehe zu:


Benutzer, die gerade dieses Thema anschauen: 1 Gast/Gäste