On Tue, Sep 6, 2016 at 5:25 PM Páll Haraldsson <[email protected]>
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. However,
I just tried adding it to the test and I get 2 s, which is way too high to
be correct (I'll file an issue).



> As I need neither, I've only looked a bit into, interactive C++ seems
> awesome in Cxx.jl, but is it fair to say the other package is [more]
> stable? Cxx.jl requires 0.5, that is just around the corner, I'm not sure
> the state then.
>
>
I just tried it, Cxx.jl installs after Pkg.checkout and Pkg.build on the
rc3 binaries on Linux. The main difference with CxxWrap.jl is that Cxx.jl
allows you to embed everything straight into Julia code, while in
CxxWrap.jl all wrapping code is written in C++ and then loaded as a shared
library into Julia. It is inspired by Boost.Python and provides a
high-level interface specifically intended to expose C++ APIs in Julia. I'm
not sure which is more stable, it highly depends on the application I think.

Cheers,

Bart

Reply via email to