[Vm-dev] [NB] NativeBoost meets JIT

Igor Stasenko siguctua at gmail.com
Fri Sep 21 15:34:37 UTC 2012


On 21 September 2012 17:15, David T. Lewis <lewis at mail.msen.com> wrote:
>
> On Fri, Sep 21, 2012 at 04:59:36PM +0200, Igor Stasenko wrote:
>>
>> Hello there,
>>
>> so, we're entered a new area, where native code, generated from image
>> side can be run directly by JIT.
>> This feature was one of the first things which i wanted to try, once
>> Eliot released Cog :)
>
> I must confess that I am not do not know much about jitting and code
> generation, but ....
>

well, with this feature, one can simply provide own code for JIT and
can experiment/explore it much faster comparing to (re)compiling VM each time..
This is actually a main goal/mission of NativeBoost project. An FFI
stuff is SECONDARY.

I can't say that i know much about Cog JIT.

One of nice features of machine code, is that it has deterministic behavior:
- if it not blowing up, and works correctly it will keep working
correctly ad infinitum.

So, bit by bit i build a machine code generation snippets which never fail,
and then i can use them for higher abstractions like FFI/whatever :)

>
>>
>> So, here the result, if we extract the loop overhead, we can see the
>> difference in
>> calling our native code when it uses JIT vs using #primitiveNativeCall :
>>
>> (6995 - 679 ) / (897- 679) asFloat 28.972477064220183
>>
>> 28 times faster!!!!
>>
>
> This is very impressive work :)
>
> Dave
>



-- 
Best regards,
Igor Stasenko.


More information about the Vm-dev mailing list