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?
When calling a Julia function from C++, I think you always need to box the arguments
The error of adding Cxx was eliminated by changing small bits in the makefile. It builds successfully. I am so surprised to find that it is such a huge package with over 1GB in size.
+LIB_DEPENDENCY += $(LIBDIR)/lib$(LLVM_LIB_NAME).$(SHLIB_EXT)
in deps/BuildBootstrap.Makefile, put '+' in the line so it becomes as follows:+LIB_DEPENDENCY += $(LIBDIR)/lib$(LLVM_LIB_NAME).$(SHLIB_EXT)
Then Pkg.build("CXX")
Hello, Bart Janssens. I have a question.If eventually all things compile down to machine code, why those callings will have overhead? Why can't the compiler glue C part and julia part seamlessly at machine code level?
On Friday, September 2, 2016 at 8:51:21 PM UTC-4, K leo wrote
Much easier to call C++ from Julia, particularly with the Cxx.jl package. Performance-wise, it shouldn't matter, but it is always easier to write glue code in a higher-level language than in a lower-level language.
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).
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.
On Tue, Sep 6, 2016 at 5:25 PM Páll Haraldsson <pall.ha...@gmail.com> 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 sNormally Cxx.jl should be faster since it can inline in this case.