Okey, I found the issue and it was me doing lazy benchmark: I had forgot a debug printing function in the C code, that I had removed between the benchs. Thanks again for your time ! Thomas. 2014-08-07 21:56 GMT+02:00 stepharo <stepharo@free.fr>:
NativeBoost methods compiles native code only once (the first time they are executed) and when sessionId changes (because you may be on a different platform). So this is already like that. The assembly code is cached in the method literal.
Stef
On 7/8/14 17:25, Thomas Bany wrote:
Hi everyone,
I'm trying to reduce the computation time of the following pseudo-code:
- memory allocation (~40 doubles) - object heap to C heap copying - NativeBoost call (nbCall:) - memory freeing
The time profiling results are bellow:
- 24*3600 calls : > 1 minute - 24*3600 calls with only memory allocation and copying : < 1 second - 1 call with a 24*3600 loop inside de C code : < 1 second
So it appears that the very coslty step is the transition from Pharo to C. And I was wondering if it was possible to drasticly reduce this time by doing something like, generate the the machine code once and call it multiple time ?
Thanks in advance !
Thomas.