mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-03 16:21:06 +00:00
remove unnecessary memset in strcoll
This patch avoids some initialization overhead in the hot path of strcoll by replacing a memset with zero assignments. It improves the file listing benchmark by 15% on x86. Tests are ok. filelist#C -1.30% filelist#en_US.UTF-8 -15.08% lorem_ipsum#vi_VN.UTF-8 -15.04% lorem_ipsum#ar_SA.UTF-8 -11.83% lorem_ipsum#en_US.UTF-8 -9.66% lorem_ipsum#zh_CN.UTF-8 -8.63% lorem_ipsum#cs_CZ.UTF-8 -8.28% lorem_ipsum#en_GB.UTF-8 -18.07% lorem_ipsum#da_DK.UTF-8 -11.13% lorem_ipsum#pl_PL.UTF-8 -15.31% lorem_ipsum#fr_FR.UTF-8 -12.26% lorem_ipsum#pt_PT.UTF-8 -10.64% lorem_ipsum#el_GR.UTF-8 -8.19% lorem_ipsum#ru_RU.UTF-8 -0.65% lorem_ipsum#iw_IL.UTF-8 -14.92% lorem_ipsum#es_ES.UTF-8 -11.47% lorem_ipsum#hi_IN.UTF-8 -1.05% lorem_ipsum#sv_SE.UTF-8 6.44% lorem_ipsum#hu_HU.UTF-8 -9.85% lorem_ipsum#tr_TR.UTF-8 -14.96% lorem_ipsum#is_IS.UTF-8 -10.35% lorem_ipsum#it_IT.UTF-8 -11.33% lorem_ipsum#sr_RS.UTF-8 -9.88% lorem_ipsum#ja_JP.UTF-8 -3.23% * string/strcoll_l.c (STRCOLL): Remove unnecessary memset.
This commit is contained in:
parent
f48b67323a
commit
ef635a29f7
@ -1,5 +1,7 @@
|
||||
2015-06-22 Leonhard Holz <leonhard.holz@web.de>
|
||||
|
||||
* string/strcoll_l.c (STRCOLL): Remove unnecessary memset.
|
||||
|
||||
* string/strcoll_l.c: Remove unused struct element idxnow.
|
||||
|
||||
2015-06-21 Joseph Myers <joseph@codesourcery.com>
|
||||
|
@ -315,8 +315,11 @@ STRCOLL (const STRING_TYPE *s1, const STRING_TYPE *s2, __locale_t l)
|
||||
int result = 0, rule = 0;
|
||||
|
||||
coll_seq seq1, seq2;
|
||||
memset (&seq1, 0, sizeof (seq1));
|
||||
seq2 = seq1;
|
||||
seq1.len = 0;
|
||||
seq1.idxmax = 0;
|
||||
seq1.rule = 0;
|
||||
seq2.len = 0;
|
||||
seq2.idxmax = 0;
|
||||
|
||||
for (int pass = 0; pass < nrules; ++pass)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user