From: Heng Li Date: Fri, 23 Sep 2011 04:02:36 +0000 (-0400) Subject: remove ksprintf_fast() X-Git-Tag: spawn-final~88 X-Git-Url: http://git.kaiwu.me/postgresql/log/contrib/postgres_fdw/stylesheets/print.css?a=commitdiff_plain;h=5bf30c2b6e058a5e63166a3bddc1839404ed2b40;p=klib.git remove ksprintf_fast() --- diff --git a/test/kstring_sprintf.cc b/test/kstring_sprintf.cc deleted file mode 100644 index 64bb14c..0000000 --- a/test/kstring_sprintf.cc +++ /dev/null @@ -1,59 +0,0 @@ -#include -#include -#include -#include -#include -#include "kstring.h" - -using namespace std; - -int main(int argc, char *argv) -{ - int i, N = 1<<21; - kstring_t str; - clock_t beg; - char buf[256]; - ostringstream ostr; - - str.l = str.m = 0; str.s = 0; - - beg = clock(); - for (i = 0; i < N; ++i) { - str.l = 0; - ksprintf_fast(&str, "%d\n", i); - } - printf("int, ksprintf_fast(): %.3f\n", (double)(clock() - beg) / CLOCKS_PER_SEC); - - beg = clock(); - for (i = 0; i < N; ++i) - sprintf(buf, "%d\n", i); - printf("int, sprintf(): %.3f\n", (double)(clock() - beg) / CLOCKS_PER_SEC); - - beg = clock(); - for (i = 0; i < N; ++i) { - str.l = 0; - kputw(i, &str); kputc('\n', &str); - } - printf("int, kputw/kputc(): %.3f\n", (double)(clock() - beg) / CLOCKS_PER_SEC); - - beg = clock(); - for (i = 0; i < N; ++i) { - ostr.seekp(0); - ostr<