Having fun with Pharo

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

Having fun with Pharo

Aliaksei Syrel
Hi

Did you know that `2 * 10.2` is two times slower than `2 asFloat * 10.2`?

Here is performance test (inspect result, takes ~10s to complete):

Who knows how performance can be improved with this knowledge...

Cheers,
Alex
Reply | Threaded
Open this post in threaded view
|

Re: Having fun with Pharo

webwarrior
Aliaksei Syrel wrote
Hi

Did you know that `2 * 10.2` is two times slower than `2 asFloat * 10.2`?

Here is performance test (inspect result, takes ~10s to complete):
http://ws.stfx.eu/4T0CR23OURZW

Who knows how performance can be improved with this knowledge...

Cheers,
Alex
And on pre-Spur VM it's like 6 or 7 times slower.

More interesting fact is that (float * int) gets optimized, but (int * float) doesn't.

It would be cool to have an up-to-date document explaining preformance characteristics of Pharo code and optimizations done by compiler/JIT.

Right now only source of such stuff seems to be the blog of Clément Béra (https://clementbera.wordpress.com/)