Quick Note : JXcore is a fork on the open source Node.js project (read more)

Javascript has always been considered as a scripting language with low performance compared to most low level languages. Thanks to V8 engine, it is now becoming a platform where developers can prepare a fully functional backend. When I first started developing JS on the server side, I simply couldn’t believe how fast the project development cycle was improved. Indeed, with a remarkable performance.

In order to get more performance from the system, we recently implemented a multithreading feature and quite happy with it’s performance. Especially on the second release, we improved its performance (up to 30%) since we updated the way it was handling the http calls. If you didn’t test it yet, you can download it from here.

Although JXcore’s performance is getting better with every release, I decided to implement an LLVM Javascript frontend prototype as a side project to see its performance compared to V8. Last weekend I could finish the prototype and measure the initial performance of the solution. Before sharing the results, I would like to remind that the current prototype has an initial level support for almost all of the challenging features (Dynamic Type System, Unicode, Javascript style Object Oriented, Calling C methods from other libraries directly). Hence I was able to compare the results with JXcore on top of V8 engine.

Note: I kept the loops as big as to see the differences in milliseconds level.

Number Test Result (source code here)
V8 JX      —– > total 122,…. ms
LLVM JX —- >  total 84,…. ms

String Test Result (source code here)
V8 JX      —– > total 573,…. ms
LLVM JX —– > total 438,…. ms

Better performance. Although the difference is not that big, considering the list of additional advantages with LLVM, we can significantly benefit from JX on LLVM. Although the dynamic type support was quite a big deal to implement, all the remaining parts will be much easier.

Advantages of JX with LLVM:
- Develop totally native applications for both desktop and mobile. Develop for IOS, Android, and other platforms natively!
(not doable with V8. Besides IOS appStore doesn’t accept JIT based solutions!)

- Consistent performance. ( GC thread )
(not like the V8 engine pausing the ‘whole application!!’ for GC)

- Develop every part of the solution in Javascript. No need to implement parts of the project in C++ for better performance

- No HEAP memory restrictions

- Access other LLVM backed languages natively without developing a special addon interface

- Access many cool LLVM and low level tools for your Javascript solution

Disadvantages of JX with LLVM:
- Bigger package size
(Right now the JX executable is under 5mb. After LLVM the development package will be around 80Mb or more)

Personally, I am very excited with prospects of running our engine on top of LLVM. Also, developing native for mobile using Javascript will be a total fun!

obastemur /