I have been playing a bit with anonymous subclasses, and instances of anon subclasses seem slower to execute code than "regular" subclasses instances, but sometimes they reach equivalent performances (for code defined in anon-subclasses). I don't understand why. Steven. |
Hi Steven. Could you show code which you measure? 2017-06-16 17:17 GMT+02:00 Steven Costiou <[hidden email]>:
|
You can find the code below. I just change the call to m by m1 to test the two methods. I started again in a fresh pharo 6 image and now the results seem all similar for the following code. I will do all my tests again to see if it was my fault but it takes a lot of time (2 hours for each full test). What sould be the expected results ? Should an instance of an anonymous class be as fast as a regular instance when calling the same code, being defined in the anon class or its super class ?
A implements m ^100 printString and B subclass of A implements m1 ^100 printString a := B new.
Steven.
Le 2017-06-16 17:31, Denis Kudriashov a écrit :
|
I spent my day testing and comparing execution speed between classes and anonymous subclasses when i tried to compare two sets of values between pharo classes: they also differ. In fact it seems that every instruction has a different execution speed if we run it enough times. So it seems impossible to precisely compare execution time between anon classes and pharo classes, at least i don't know how to do it. I computed confidence intervals of various measures, the differences in execution time that exist between classes and anonymous classes can be between -2% to + 9%. But comparing sets of speed between pharo classes, i also have similar intervals (but smaller, from -2% speed to +5% speed).
So maybe they have similar performances, at least sometimes they do and sometimes one is slightly faster than the other, but in the end it is not possible to tell. But maybe i'm looking for something which does not even exist, maybe anonymous classes are designed to be as fast as regular classes ? Or maybe it is common to have such variability when benchmarking code ?
Does it exist any instruction in pharo with a constant execution time ? (or it could be possible with one million years to compute enough speed tests and do an accurate mean...)
Steven.
Le 2017-06-16 18:14, Steven Costiou a écrit :
|
@all, Is there some way to disable garbage collection during such benchmarks?
cheers -ben On Sun, Jun 18, 2017 at 3:51 AM, Steven Costiou <[hidden email]> wrote:
|
Free forum by Nabble | Edit this page |