c++multithreadingnode.jsjxcore

Node addons available in JXcore using LLVM


I apologize if this is not the correct place to post this question or if it is similar to questions asked before.

I am doing some research into how to put a web interface on a C++ project I want to start. I came across Node.js and checked out a few of the addons using the V8 engine.

My idea is to route business logic (DB(sqlite), CRM, CMS, etc) to the C++ backend and handle stuff like websocket connections, form validations, etc. within Node.

JXcore has very appealing specs on paper so I am very interested in trying it out, but I am unsure about how my addon will be affected seeing that JXcore has a future objective to move from V8 to LLVM. Hopefully there will be options available to bridge JS with C++.

So, based on the above, I have the following options available:

  1. do everything in Node (no C++ addon)
  2. use JXcore or Node and c++ addon without multithreading
  3. use JXcore or Node and implement multithreading in my C++ addon using libuv for instance
  4. do everything in JXcore (no C++ addon)

Which one of the options above would be the better route to go with in regards to performance, in your opinion? I would also appreciate any alternative options to the above.


Solution

  • I don't think you will need C++ addons for performance (especially in your case) if you pick JXcore path. First of all, V8 is very fast and using multithreading you already have the whole CPU capacity behind. The second and most important part is, when JXcore updates V8 to LLVM, your Javascript sources will be compiled into native code.

    As mentioned from here, they already embedded (beta2 and later) some of the popular c++ addons (multithreaded) and released a wrapper header file in order to develop multithreading friendly c++ addons easily.

    More information on JXcore