BAEL-4644: Small test to check Java JIT compiler performances vs C++ … (#10412)

* BAEL-4644: Small test to check Java JIT compiler performances vs C++ and JS

* BAEL-4644: Remove CSV with performance test results

* Revert "BAEL-4644: Remove CSV with performance test results"

This reverts commit a69c9667
This commit is contained in:
Daniel Strmecki
2021-01-22 08:53:02 +01:00
committed by GitHub
parent 26c646f6fc
commit d90c7fed48
4 changed files with 156 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
#include <iostream>
#include <chrono>
using namespace std;
int fibonacci(int n) {
if (n <= 1)
return n;
return fibonacci(n - 1) + fibonacci(n - 2);
}
int main() {
for (int i = 0; i < 100; i++) {
auto startTime = chrono::high_resolution_clock::now().time_since_epoch();
int result = fibonacci(12);
auto totalTime = chrono::high_resolution_clock::now().time_since_epoch() - startTime;
cout << totalTime << "\n";
}
}
+14
View File
@@ -0,0 +1,14 @@
function fibonacci(index) {
if (index <= 1)
return index;
return fibonacci(index-1) + fibonacci(index-2);
}
for (var i=0; i<100; i++) {
var startTime = process.hrtime.bigint();
var result = fibonacci(12);
var totalTime = process.hrtime.bigint() - startTime;
console.log(totalTime);
}