[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
sprintf() of gawk in cvs works very slow under ja_JP.UTF8
From: |
Hirofumi Saito |
Subject: |
sprintf() of gawk in cvs works very slow under ja_JP.UTF8 |
Date: |
Sun, 1 Feb 2009 03:12:25 +0900 |
Hello,
The sprintf() function of latest gawk in CVS is very very slow.
I've checked the script below.
$ cat test.awk
BEGIN {
str = "abc";
for (i = 1; i <= 10000; i++) {
result = sprintf("%s%s", result, str);
}
print result;
}
$ time gawk -f test.awk > /dev/null
gawk -f test.awk > /dev/null 7.61s user 0.01s system 99% cpu 7.674 total
But under C locale, it works very fast (over 100 times faster!!).
$ time LC_ALL=C gawk -f test.awk > /dev/null
LC_ALL=C gawk -f test.awk > /dev/null 0.05s user 0.00s system 18% cpu 0.301
total
The release version of gawk-3.1.6 works fast under ja_JP.UTF8.
$ time ../gawk-3.1.6/gawk -f test.awk > /dev/null
../gawk-3.1.6/gawk -f test.awk > /dev/null 0.05s user 0.00s system 95% cpu
0.056 total
regards,
Hirofumi Saito.