Skip to main content

Posts

Showing posts from June, 2018

WebAssembly experiment: C++ vs JS

Introduction WebAssembly brings the webapp executes as fast as running machine code. It is now supported in all major browsers (Chrome, Firefox, Edge, Safari). I’m very excited about the potential so I started to evaluate it. This is an experimental webapp to demonstrate how to call the external C++ module from Javascript. In addition, here also compares the performance for manipulating a list of products in C++ (with STL) versus Javascript (with Lodash ). Contents of this Blog: Development environment setup Develop C++ module Develop the web interface Develop Javascript module Performance comparison result 1. Development Environment Setup In my development environment, I’m using MacOSX 10.11 EI Capitan. The programming language versions I installed as below: $ node -v # v8.9.1 $ python -V # Python 2.7.13 $ java -version # java version "1.8.0_171" $ clang++ -v # clang version 6.0.1  (emscripten 1.38.6 : 1.38.6) $ cmake -version # cmake version 3.11.4 Install Visual Studio Co