On Tuesday, September 6, 2016 at 8:13:57 PM UTC, Bart Janssens wrote:
>
>
>
> On Tue, Sep 6, 2016 at 5:25 PM Páll Haraldsson <[email protected]
> <javascript:>> wrote:
>
>>
>> As far as I understand:
>>
>> https://github.com/barche/CxxWrap.jl
>>
>> should also be [as, not faster or slower] fast. Meaning runtime speed (of
>> not development speed).
>>
>
> CxxWrap.jl actually has a slightly higher overhead: many calls are
> diverted to a C++ std::function, which has an inherent overhead. CxxWrap
> includes a benchmark (in the package test suite) where all elements of a
> 50000000-element Float64 array are divided by 2, using the function in the
> loop. Timings on Linux with julia0.5-rc3 are:
> - Pure C++ and pure Julia are the same at 0.06 s
> - ccall on a C function or a CxxWrap C++ function that can be called as a
> C function: 0.09 s
> - CxxWrap function in the general case: 0.14 s
>
> Normally Cxx.jl should be faster since it can inline in this case.
>
Not sure I understand ("this case"), in another thread Tim Holy cautioned
that C++ would not be inlined into Julia functions, as Julia functions can
be.
[I understand you can debug Julia and C++ code, with Gallium, e.g. from one
language to the next, that is across function boundaries.]