Re: Faster StrNCpy

Поиск
Список
Период
Сортировка
От Sergey E. Koposov
Тема Re: Faster StrNCpy
Дата
Msg-id Pine.LNX.4.64.0610022344460.12197@lnfm1.sai.msu.ru
обсуждение исходный текст
Ответ на Re: Faster StrNCpy  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Faster StrNCpy  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Mark, Tom,

Just the test on IA64 (Itanium2, 1.6Ghz, 8Gb memory). The results seem to
be quite different:

math@ptah:~/test$ gcc -O3 -std=c99 -DSTRING='"This is a very long sentence that is expected to be very slow."'
-DN="(1024*1024)"-o x x.c y.c strlcpy.c ; ./x
 
NONE:        825671 us
MEMCPY:     4533637 us
STRNCPY:   10959380 us
STRLCPY:   34258306 us
LENCPY:    13939373 us
math@ptah:~/test$ gcc -O3 -std=c99 -DSTRING='"This is a very long sentence that is expected to be very slow."' -DN="1"
-ox x.c y.c strlcpy.c ; ./x
 
NONE:        938815 us
MEMCPY:     3441330 us
STRNCPY:    5881628 us
STRLCPY:   20167825 us
LENCPY:    11326259 us

math@ptah:~/test$ gcc -O3 -std=c99 -DSTRING='"Short sentence."' -DN="(1024*1024)" -o x x.c y.c strlcpy.c ; ./x
NONE:        831920 us
MEMCPY:     4550683 us
STRNCPY:    9339254 us
STRLCPY:   16871433 us
LENCPY:    21332076 us
math@ptah:~/test$ gcc -O3 -std=c99 -DSTRING='"Short sentence."' -DN="1" -o x x.c y.c strlcpy.c ; ./x
NONE:        938104 us
MEMCPY:     3438871 us
STRNCPY:    3438969 us
STRLCPY:    6042829 us
LENCPY:     6022909 us

math@ptah:~/test$ gcc -O3 -std=c99 -DSTRING='""' -DN="(1024*1024)" -o x x.c y.c strlcpy.c ; ./x 
NONE:        825472 us
MEMCPY:     4547456 us
STRNCPY:    8591618 us 
STRLCPY:    6818957 us
LENCPY:     8264340 us
math@ptah:~/test$ gcc -O3 -std=c99 -DSTRING='""' -DN="1" -o x x.c y.c strlcpy.c ; ./x 
NONE:        937878 us
MEMCPY:     3439101 us
STRNCPY:    3188791 us 
STRLCPY:     750437 us
LENCPY:     2751238 us


Regards,    Sergey

*******************************************************************
Sergey E. Koposov
Max Planck Institute for Astronomy/Sternberg Astronomical Institute
Tel: +49-6221-528-349
Web: http://lnfm1.sai.msu.ru/~math
E-mail: math@sai.msu.ru



В списке pgsql-hackers по дате отправления:

Предыдущее
От: mark@mark.mielke.cc
Дата:
Сообщение: Re: Faster StrNCpy
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Faster StrNCpy