This project uses the capability to develop Node.js addons using C++, subsequently analyzing the algorithmic execution time in the Node.js runtime environment for both JavaScript and C++.
Note: The same case runs by all kinds of algorithms per one iteration.
- sort() and std::sort()
- Bubble Sort
- Selection Sort
- Insertion Sort
- Merge Sort
- Quicksort
- Heapsort
- Counting Sort
- Radix Sort
To get proper build of C++ addon:
- use VSCode
- change
includePath
inc_cpp_properties.json
to path of your localnode-gyp
To build C++ addon, TypeScript to JS and run project use npm start
To build C++ addon and start TypeScript use npm run start:ts
- Build of C++ addon;
- Compiling TypeScript to JavaScript;
- Algorithms execution;
- Saving result data;
- Starting server at http://localhost:3000 with results charts.
You can change length of arrays for algorithms and number of iterations in config file.
Keep in mind limit of numbers in JS and integers in C++.
{
"sortIterations": 20,
"searchIterations": 20,
"sortArrayLength": [ 1000, 2000, 3000, 4000, 5000 ],
"searchArrayLength": [ 10000, 50000, 100000, 150000, 200000 ]
}