[Gambas-user] Question about Gambas3

Benoît Minisini gambas at ...1...
Thu May 17 20:45:46 CEST 2012


Le 17/05/2012 19:57, Emil Lenngren a écrit :
> What exactly were the problems, how far did you come?
>
> Maybe add an instruction in the compiled code that is inserted in the
> beginning of each function, when a (new) profiling compilation flag is
> active.
> When that instruction is executed, a counter that counts how many time that
> function is incremented. Also one instruction can be inserted just before
> Return. Then the running time can be measured. (Exceptions must also be
> considerated...)
> Gprof uses a similar method.
>
> Or skip new instructions and implement it directly in the interpreter "if
> (profiling_active) ...", but that extra if-statement might slow down the
> execution when profiling is not active...
>
> There are surely more ways to implement it ;)
>
> /Emil
>

I wanted to use setitimer() and note which function we are executing 
each microsecond (for example).

The other solution (yours) seems to be better. I'd like to note the time 
spent in each line too, it may be useful. I will see!

By the way, don't you have something to show us?

-- 
Benoît Minisini




More information about the User mailing list