Re: FFI in interpreter mode

  • From: Pierre-Yves Gérardy <pygy79@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Wed, 23 May 2012 17:52:10 +0200

Ok, thanks for giving it a try :-)

-- Pierre-Yves


On Wed, May 23, 2012 at 5:14 PM, Evan Wies <evan@xxxxxxxxxxxxx> wrote:

>  Pierre-Yves,
>
> Sorry, I totally misread your (so-short-how-did-I-misread-it) message.
>
> I installed luaffi and started running against it.   I needed to change
> some of the ffi.cdefs to make progress.  Once I got through that and a
> couple minor things, I reached this error and gave up:
>
> lua: unable to convert argument 2 from cdata<int> to cdata<int64_t>
>
> FWIW, this was within S.open() of ljsyscall
>
> Regards,
> Evan
>
>
>
>
> On 05/23/2012 10:53 AM, Pierre-Yves Gérardy wrote:
>
> LuaFFI is an independent implementation of the FFI API. It's meant to
> provide LuaJIT-style FFI compatibility to the standard Lua interpreter.
>
>  Since Mike says that his FFI lib is slow in interpreter mode, I wonder
> how this one will fare...
>
>  https://github.com/jmckaskill/luaffi
>
>  If you have the time to try it, after installation, require LuaFFI
> instead of FFI, and it will probably work (there are minor differences in
> the API).
>
>  Kind regards
> -- Pierre-Yves
>
>
> On Wed, May 23, 2012 at 3:21 PM, Evan Wies <evan@xxxxxxxxxxxxx> wrote:
>
>>  I thought that's what -joff does?  (75.3s vs 10.2s baseline)   If
>> there's a specific set of command-line arguments you want me to run, just
>> let me know.
>>
>> -Evan
>>
>>
>>
>> On 05/23/2012 08:49 AM, Pierre-Yves Gérardy wrote:
>>
>> Out of curiosity, could you test it with LuaFFI in interpreter mode?
>>
>>  -- Pierre-Yves
>>
>>
>> On Tue, May 22, 2012 at 11:29 PM, Evan Wies <evan@xxxxxxxxxxxxx> wrote:
>>
>>> I just happened to try this out on a FFI-heavy program I'm working on.
>>> It reads one large file of messages and writes each message to one of many
>>> (thousands) of files based on simple information in the message.  The file
>>> is 175M and contains 8.3 million messages.
>>>
>>> I just now ran it now once with different luajit options (on x64 writing
>>> to SSD):
>>> none   10.2s
>>> -O3    10.1s
>>> -O2    29.5s
>>> -O1    29.4s
>>> -joff  75.3
>>>
>>> This cool thing is that the C++ version of program runs in 8.0s!   The
>>> LuaJIT FFI version is fresh meat and hasn't been optimized much -- amazing
>>> it is so close without much effort.
>>>
>>> -Evan
>>>
>>>
>>> On 05/22/2012 06:03 AM, Mike Pall wrote:
>>>
>>>> Olivier Goudron wrote:
>>>>
>>>>> I would like to know if the interpreter mode fallback for X86 CPU
>>>>> without
>>>>> SSE2 support allow FFI or not ?
>>>>>
>>>> Yes.
>>>>
>>>> But please note that the FFI functionality is rather slow in
>>>> interpreted mode. Should be ok for the occasional C call, though.
>>>>
>>>> --Mike
>>>>
>>>>
>>>
>>>
>>
>>
>
>

Other related posts: