Hi
Is it possible to compare methods time execution...
I know the possiblity to use Time millisecondsToRun: aBlock but it's not really useful... I've seen a profiler but not really sure...
My aim is just to compare for instance the access to an existing dictionary, or creating it with several methods...
If you have any hints Thanks...
ps: what is a "reasonnable" execution time ?
cdrick wrote:
Hi
Is it possible to compare methods time execution...
I know the possiblity to use Time millisecondsToRun: aBlock but it's not really useful... I've seen a profiler but not really sure...
My aim is just to compare for instance the access to an existing dictionary, or creating it with several methods...
I use the "TimeProfileBrowser":
TimeProfileBrowser spyOn: ["your code goes here"]
The code in the block should take at least 1 second to get a reasonable number of samples. If you need to you can always do something like:
TimeProfileBrowser spyOn: [100 timesRepeat: ["your code goes here"]]
Keep in mind that spyOn: does its work by sampling the stack at fixed intervals...have a look at the class docs for MessageTally for more details and alternatives.
David
beginners@lists.squeakfoundation.org