A benchmarking package or lib ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

A benchmarking package or lib ?

Steven Costiou-2

Hi,

is there any benchmark library for Pharo ? that would provide tools to choose metrics to measure between two versions of the same code and maybe display a comparison or something (whatever the form of the report) ?

I've found BenchmarkResult in Pharo but it seems very basic, at least there are no detailed examples of how it could be used.

I'm specifically looking for a way to measure the speed of method calls (if that is possible) or the memory usage, but i'm also curious in general about what is measureable and try different benchmarks to see the results. So if there were a tool already doing all this work... ?

Steven.

 

 

Reply | Threaded
Open this post in threaded view
|

Re: A benchmarking package or lib ?

Stephane Ducasse-3
Check Smark and clement and vm guys has a lot of benchmarks


On Thu, May 25, 2017 at 12:51 PM, Steven Costiou <[hidden email]> wrote:

Hi,

is there any benchmark library for Pharo ? that would provide tools to choose metrics to measure between two versions of the same code and maybe display a comparison or something (whatever the form of the report) ?

I've found BenchmarkResult in Pharo but it seems very basic, at least there are no detailed examples of how it could be used.

I'm specifically looking for a way to measure the speed of method calls (if that is possible) or the memory usage, but i'm also curious in general about what is measureable and try different benchmarks to see the results. So if there were a tool already doing all this work... ?

Steven.

 

 


Reply | Threaded
Open this post in threaded view
|

Re: A benchmarking package or lib ?

philippeback
In reply to this post by Steven Costiou-2
You can do things like:

MessageTally spyOn: [ 1 to: 1000 do: [ :i | i primeFactors logCr ] ].

or

AndreasSystemProfiler spyOn: [ 1 to: 1000 do: [ :i | i primeFactors logCr ] ].


or

[ 1000 primeFactors ] benchFor: 5 seconds

--> "a BenchmarkResult(11,386,117 iterations in 5 seconds. 2,277,223 per second)"

or

[ 1000000 timesRepeat: [  1000 primeFactors ] ] timeToRun

--> "0:00:00:01.055"

etc.

http://www.smalltalkhub.com/#!/~StefanMarr/SMark is also interesting and more like a framework.

ZnBase64EncoderTests class side has a few bench methods:


bench10kEncode
"self bench10kEncode"
| bytes |
bytes := ByteArray new: 10240 streamContents: [ :out |
10240 timesRepeat: [ out nextPut: 256 atRandom - 1 ] ].
^ [ ZnBase64Encoder new encode: bytes ] bench


HTH

Phil






On Thu, May 25, 2017 at 12:51 PM, Steven Costiou <[hidden email]> wrote:

Hi,

is there any benchmark library for Pharo ? that would provide tools to choose metrics to measure between two versions of the same code and maybe display a comparison or something (whatever the form of the report) ?

I've found BenchmarkResult in Pharo but it seems very basic, at least there are no detailed examples of how it could be used.

I'm specifically looking for a way to measure the speed of method calls (if that is possible) or the memory usage, but i'm also curious in general about what is measureable and try different benchmarks to see the results. So if there were a tool already doing all this work... ?

Steven.

 

 


Reply | Threaded
Open this post in threaded view
|

Re: A benchmarking package or lib ?

Ben Coman
In reply to this post by Steven Costiou-2
On Thu, May 25, 2017 at 6:51 PM, Steven Costiou <[hidden email]> wrote:

> Hi,
>
> is there any benchmark library for Pharo ? that would provide tools to
> choose metrics to measure between two versions of the same code and maybe
> display a comparison or something (whatever the form of the report) ?
>
> I've found BenchmarkResult in Pharo but it seems very basic, at least there
> are no detailed examples of how it could be used.
>
> I'm specifically looking for a way to measure the speed of method calls (if
> that is possible) or the memory usage, but i'm also curious in general about
> what is measureable and try different benchmarks to see the results. So if
> there were a tool already doing all this work... ?
>
> Steven.


I think not quite what you want but may be interesting...
http://forum.world.st/A-Benchmarking-tool-for-the-trunk-td4892463.html
http://forum.world.st/Call-for-big-benchmarks-td4939568.html

cheers -ben

Reply | Threaded
Open this post in threaded view
|

Re: A benchmarking package or lib ?

Steven Costiou-2
In reply to this post by Steven Costiou-2

Thank you all for your answers :)

I will have a look into all that :)

Steven.