Update benchmarks

This commit is contained in:
Minseong Jang
2025-06-13 15:19:21 +09:00
parent 49410f5264
commit 1aa18bce30
11 changed files with 201 additions and 193 deletions

View File

@@ -1,36 +1,36 @@
int fibonacci_loop(int n, int nonce) {
int result = 0;
int result = 0;
for (int step = 0; step < 10; ++step) {
int x = nonce;
int y = nonce;
for (int step = 0; step < 10; ++step) {
int x = nonce;
int y = nonce;
for (int i = 1; i < n; ++i) {
int newy = x + y;
newy += (x + y);
newy += (x + y);
newy += (x + y);
newy += (x + y);
newy += (x + y);
newy -= (x + y);
newy -= (x + y);
newy -= (x + y);
newy -= (x + y);
newy -= (x + y);
x = y;
y = newy;
for (int i = 1; i < n; ++i) {
int newy = x + y;
newy += (x + y);
newy += (x + y);
newy += (x + y);
newy += (x + y);
newy += (x + y);
newy -= (x + y);
newy -= (x + y);
newy -= (x + y);
newy -= (x + y);
newy -= (x + y);
x = y;
y = newy;
}
result += y;
}
result += y;
}
return result;
return result;
}
int fibonacci_recursive(int n, int nonce) {
if (n < 2) {
return nonce;
}
if (n < 2) {
return nonce;
}
return fibonacci_recursive(n - 1, nonce) + fibonacci_recursive(n - 2, nonce);
return fibonacci_recursive(n - 1, nonce) + fibonacci_recursive(n - 2, nonce);
}