Hi,

I'd say the better option in terms of performance depends on which path
allows you to limit the number of calls into the other language, since
there will often be some overhead in calling Julia from C++ or vice versa,
even if it's just because things are less transparent to the compiler.

When calling a Julia function from C++, I think you always need to box the
arguments, which may be slower than calling C++ from Julia. Also remember
to cache the pointer to the Julia function, to avoid the name lookup on
every call.

To call C++ functions from Julia, you can also use my CxxWrap package,
which allows you to write the Julia interface as a C++ library:
https://github.com/barche/CxxWrap.jl

Cheers,

Bart

On Sat, Sep 3, 2016 at 2:51 AM K leo <[email protected]> wrote:

> While the majority of my analytics are in Julia, I will need to use an
> external event handling API which is implemented in C++.  It looks that I
> have two options: 1) write the main code in C++ with the API and call Julia
> function for analytics; 2) write the main code also in Julia that work
> seamlessly with my analytics and call the C++ API for events.
>
> Which would be the better path in terms of ease of coding and performance?
>

Reply via email to