You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've compiled and run very basic performance test.
Virtualization penalty under AVF for simple computation is about 1.2 times slower compared to run in Termux (i.e. android kernel).
System that I have is Samsung Gwlaxy Tab S11 (Dimensity 9400+)
Is it expected? Doesn't seem like "near native" performance.
What i get in VM (that's average in multiple runs so no throttling interference)
podroid:# /root/bench 3000000000
INT: 3.211 sec, 934.17 Mops/s (sum=8317209874376305593)
DBL: 9.582 sec, 156.55 Mops/s (sum=inf)
podroid:#
What I get in Termux:
~ $ ~/bench 3000000000
INT: 2.559 sec, 1172.41 Mops/s (sum=8317209874376305593)
DBL: 8.491 sec, 176.66 Mops/s (sum=inf)
~ $
Code that I run (in both podroid's alpine VM and Termux)
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
static void bench_int(long n) {
long long a = 1, b = 2;
clock_t start = clock();
for (long i = 0; i < n; i++) {
a = a * 3 + b;
b = b * 3 + a;
a ^= (a >> 7);
b ^= (b >> 7);
}
clock_t end = clock();
double t = (double)(end - start) / CLOCKS_PER_SEC;
printf("INT: %8.3f sec, %7.2f Mops/s (sum=%lld)\n", t, n / t / 1e6, a + b);
}
static void bench_double(long n) {
double a = 1.0, b = 2.0;
clock_t start = clock();
for (long i = 0; i < n; i++) {
a = a * 1.0000001 + b;
b = b * 1.0000001 + a;
a = a / 1.0000001;
b = b / 1.0000001;
}
clock_t end = clock();
double t = (double)(end - start) / CLOCKS_PER_SEC;
printf("DBL: %8.3f sec, %7.2f Mops/s (sum=%f)\n", t, n / t / 1e6, a + b);
}
int main(int argc, char** argv) {
long n = 100000000;
if (argc > 1) n = atol(argv[1]);
bench_int(n);
bench_double(n / 2);
return 0;
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I've compiled and run very basic performance test.
Virtualization penalty under AVF for simple computation is about 1.2 times slower compared to run in Termux (i.e. android kernel).
System that I have is Samsung Gwlaxy Tab S11 (Dimensity 9400+)
Is it expected? Doesn't seem like "near native" performance.
What i get in VM (that's average in multiple runs so no throttling interference)
podroid:# /root/bench 3000000000
INT: 3.211 sec, 934.17 Mops/s (sum=8317209874376305593)
DBL: 9.582 sec, 156.55 Mops/s (sum=inf)
podroid:#
What I get in Termux:
~ $ ~/bench 3000000000
INT: 2.559 sec, 1172.41 Mops/s (sum=8317209874376305593)
DBL: 8.491 sec, 176.66 Mops/s (sum=inf)
~ $
Code that I run (in both podroid's alpine VM and Termux)
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
static void bench_int(long n) {
long long a = 1, b = 2;
clock_t start = clock();
for (long i = 0; i < n; i++) {
a = a * 3 + b;
b = b * 3 + a;
a ^= (a >> 7);
b ^= (b >> 7);
}
clock_t end = clock();
double t = (double)(end - start) / CLOCKS_PER_SEC;
printf("INT: %8.3f sec, %7.2f Mops/s (sum=%lld)\n", t, n / t / 1e6, a + b);
}
static void bench_double(long n) {
double a = 1.0, b = 2.0;
clock_t start = clock();
for (long i = 0; i < n; i++) {
a = a * 1.0000001 + b;
b = b * 1.0000001 + a;
a = a / 1.0000001;
b = b / 1.0000001;
}
clock_t end = clock();
double t = (double)(end - start) / CLOCKS_PER_SEC;
printf("DBL: %8.3f sec, %7.2f Mops/s (sum=%f)\n", t, n / t / 1e6, a + b);
}
int main(int argc, char** argv) {
long n = 100000000;
if (argc > 1) n = atol(argv[1]);
bench_int(n);
bench_double(n / 2);
return 0;
}
All reactions