summaryrefslogtreecommitdiff
path: root/src/test/testlauncher.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-12-22 18:37:05 +0300
committerAndrei Karas <akaras@inbox.ru>2016-12-22 18:37:05 +0300
commit3719c196c88723c0d9f05a92ef30454429a4b82f (patch)
tree62d9d972f2d000c78b27bcd7d601a68f92617896 /src/test/testlauncher.cpp
parent19aec4ec37cffa2b3f7ab84165728dfcceac008e (diff)
downloadplus-3719c196c88723c0d9f05a92ef30454429a4b82f.tar.gz
plus-3719c196c88723c0d9f05a92ef30454429a4b82f.tar.bz2
plus-3719c196c88723c0d9f05a92ef30454429a4b82f.tar.xz
plus-3719c196c88723c0d9f05a92ef30454429a4b82f.zip
Improve dye speed tests.
Diffstat (limited to 'src/test/testlauncher.cpp')
-rw-r--r--src/test/testlauncher.cpp45
1 files changed, 41 insertions, 4 deletions
diff --git a/src/test/testlauncher.cpp b/src/test/testlauncher.cpp
index 313986c8c..661960b1d 100644
--- a/src/test/testlauncher.cpp
+++ b/src/test/testlauncher.cpp
@@ -497,7 +497,7 @@ int TestLauncher::testDyeSSpeed()
clock_gettime(CLOCK_MONOTONIC, &time1);
for (int f = 0; f < 50000; f ++)
- pal.replaceSColor(buf, sz);
+ pal.replaceSColorDefault(buf, sz);
clock_gettime(CLOCK_MONOTONIC, &time2);
long diff = ((static_cast<long int>(time2.tv_sec) * 1000000000L
@@ -505,7 +505,25 @@ int TestLauncher::testDyeSSpeed()
((static_cast<long int>(time1.tv_sec) * 1000000000L
+ static_cast<long int>(time1.tv_nsec)) / 1);
printf("dye s salt: %u\n", buf[0]);
- printf("time: %ld\n", diff);
+ printf("default time: %011ld\n", diff);
+
+ for (int f = 0; f < sz; f ++)
+ buf[f] = f;
+
+ pal.replaceSColor(buf, sz);
+
+ clock_gettime(CLOCK_MONOTONIC, &time1);
+
+ for (int f = 0; f < 50000; f ++)
+ pal.replaceSColorSimd(buf, sz);
+
+ clock_gettime(CLOCK_MONOTONIC, &time2);
+ diff = ((static_cast<long int>(time2.tv_sec) * 1000000000L
+ + static_cast<long int>(time2.tv_nsec)) / 1) -
+ ((static_cast<long int>(time1.tv_sec) * 1000000000L
+ + static_cast<long int>(time1.tv_nsec)) / 1);
+ printf("dye s salt: %u\n", buf[0]);
+ printf("simd time : %011ld\n", diff);
#endif // defined __linux__ || defined __linux
return 0;
@@ -529,7 +547,7 @@ int TestLauncher::testDyeASpeed()
clock_gettime(CLOCK_MONOTONIC, &time1);
for (int f = 0; f < 50000; f ++)
- pal.replaceSColor(buf, sz);
+ pal.replaceSColorDefault(buf, sz);
clock_gettime(CLOCK_MONOTONIC, &time2);
long diff = ((static_cast<long int>(time2.tv_sec) * 1000000000L
@@ -537,7 +555,26 @@ int TestLauncher::testDyeASpeed()
((static_cast<long int>(time1.tv_sec) * 1000000000L
+ static_cast<long int>(time1.tv_nsec)) / 1);
printf("dye a salt: %u\n", buf[0]);
- printf("time: %ld\n", diff);
+ printf("default time: %011ld\n", diff);
+
+ for (int f = 0; f < sz; f ++)
+ buf[f] = f;
+
+ pal.replaceAColor(buf, sz);
+
+ clock_gettime(CLOCK_MONOTONIC, &time1);
+
+ for (int f = 0; f < 50000; f ++)
+ pal.replaceSColorSimd(buf, sz);
+
+ clock_gettime(CLOCK_MONOTONIC, &time2);
+ diff = ((static_cast<long int>(time2.tv_sec) * 1000000000L
+ + static_cast<long int>(time2.tv_nsec)) / 1) -
+ ((static_cast<long int>(time1.tv_sec) * 1000000000L
+ + static_cast<long int>(time1.tv_nsec)) / 1);
+ printf("dye a salt: %u\n", buf[0]);
+ printf("simd time : %011ld\n", diff);
+
#endif // defined __linux__ || defined __linux
return 0;