diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-07-24 09:54:23 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-07-24 09:54:44 +0000 |
commit | 836b47cb7e99a977c5a23b059ca1d0b5065d310e (patch) | |
tree | 1604da8f482d02effa033c94a84be42bc0c848c3 /web/server/h2o/libh2o/deps/klib/test/kstring_bench.c | |
parent | Releasing debian version 1.44.3-2. (diff) | |
download | netdata-836b47cb7e99a977c5a23b059ca1d0b5065d310e.tar.xz netdata-836b47cb7e99a977c5a23b059ca1d0b5065d310e.zip |
Merging upstream version 1.46.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'web/server/h2o/libh2o/deps/klib/test/kstring_bench.c')
-rw-r--r-- | web/server/h2o/libh2o/deps/klib/test/kstring_bench.c | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/web/server/h2o/libh2o/deps/klib/test/kstring_bench.c b/web/server/h2o/libh2o/deps/klib/test/kstring_bench.c deleted file mode 100644 index 82598e88c..000000000 --- a/web/server/h2o/libh2o/deps/klib/test/kstring_bench.c +++ /dev/null @@ -1,51 +0,0 @@ -#include <stdio.h> -#include <stdlib.h> -#include <time.h> -#include "kstring.h" - -#define N 10000000 - -int main() -{ - int i; - clock_t t; - kstring_t s, s2; - srand48(11); - s.l = s.m = 0; s.s = 0; - t = clock(); - for (i = 0; i < N; ++i) { - int x = lrand48(); - s.l = 0; - kputw(x, &s); - } - fprintf(stderr, "kputw: %lf\n", (double)(clock() - t) / CLOCKS_PER_SEC); - srand48(11); - t = clock(); - for (i = 0; i < N; ++i) { - int x = lrand48(); - s.l = 0; - ksprintf(&s, "%d", x); - } - fprintf(stderr, "ksprintf: %lf\n", (double)(clock() - t) / CLOCKS_PER_SEC); - - srand48(11); - s2.l = s2.m = 0; s2.s = 0; - t = clock(); - for (i = 0; i < N; ++i) { - int x = lrand48(); - s2.l = s.l = 0; - kputw(x, &s2); - kputs(s2.s, &s); - } - fprintf(stderr, "kputw+kputs: %lf\n", (double)(clock() - t) / CLOCKS_PER_SEC); - srand48(11); - t = clock(); - for (i = 0; i < N; ++i) { - int x = lrand48(); - s2.l = s.l = 0; - kputw(x, &s2); - ksprintf(&s, "%s", s2.s); - } - fprintf(stderr, "kputw+ksprintf: %lf\n", (double)(clock() - t) / CLOCKS_PER_SEC); - return 0; -} |