public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug string/26852] New: aarch64/strcmp has performance regression for some cases
@ 2020-11-09  8:10 xuchunmei at linux dot alibaba.com
  2020-11-09  8:12 ` [Bug string/26852] " xuchunmei at linux dot alibaba.com
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: xuchunmei at linux dot alibaba.com @ 2020-11-09  8:10 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=26852

            Bug ID: 26852
           Summary: aarch64/strcmp has performance regression for some
                    cases
           Product: glibc
           Version: 2.32
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: string
          Assignee: unassigned at sourceware dot org
          Reporter: xuchunmei at linux dot alibaba.com
  Target Milestone: ---

Created attachment 12948
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12948&action=edit
bench-strcmp data of glibc2.30 and glibc2.32

unixbench of dhry2reg has performance regression on glibc2.32, compared with
glibc2.30. perf record data display the regression is from strcmp. 
I simply the testcase with following code:
#include<stdio.h>
#include <string.h>

int main()
{
        int count=1000000;
        int i = 0;
        char str1[32] = "DHRYSTONE PROGRAM, 1'ST STRING";
        char str2[32] = "DHRYSTONE PROGRAM, 2'ND STRING";
        int ret;

        while (i<count) {
                ret = strcmp(str1, str2);
                if (ret > 0)
                        printf("11111\n");
                i++;
        }
}

and compare the execute time on glibc2.30 abd glibc2.32.
on glibc2.30, the result is:
# time ./test

real    0m0.008s
user    0m0.008s
sys     0m0.000s
while on glibc2.32, the result is:
# time ./test

real    0m0.023s
user    0m0.023s
sys     0m0.000s

also,I modify bench-strcmp.c to test length=20, add the following code:
  do_test(&json_ctx, 0, 0, 20, MIDCHAR, 0);
  do_test(&json_ctx, 0, 1, 20, MIDCHAR, 0);
  do_test(&json_ctx, 1, 0, 20, MIDCHAR, 0);
  do_test(&json_ctx, 1, 1, 20, MIDCHAR, 0);

on glibc2.30, result is:
       length=20, align1=0, align2=0:         7.69             20.39 (-164.98%)
       length=20, align1=0, align2=1:        10.00             20.49 (-104.84%)
       length=20, align1=1, align2=0:        13.57             20.53 (-51.30%)
       length=20, align1=1, align2=1:         8.85             20.39 (-130.33%)
on glibc2.32, result is:
       length=20, align1=0, align2=0:         7.81             20.00 (-156.15%)
       length=20, align1=0, align2=1:        26.54             20.16 ( 24.02%)
       length=20, align1=1, align2=0:        14.24             20.00 (-40.50%)
       length=20, align1=1, align2=1:         8.47             20.12 (-137.67%)

glibc2.32 with "length=20, align1=0, align2=1" has a performance regression.

glibc2.32 only have one more commit than glibc2.30 with
sysdeps/aarch64/strcmp.S:
commit adac54ffc5ded48cba7deb18e46df984b213b0ac
Author: Alex Butler <Alex.Butler@arm.com>
Date:   Tue Jun 16 12:42:38 2020 +0000

    aarch64: MTE compatible strcmp


also I compare bench-strcmp data between glibc2.30 and glibc2.32, refer to the
attachment. In some cases, glibc2.32 have performace regression.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2022-03-16 18:53 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-09  8:10 [Bug string/26852] New: aarch64/strcmp has performance regression for some cases xuchunmei at linux dot alibaba.com
2020-11-09  8:12 ` [Bug string/26852] " xuchunmei at linux dot alibaba.com
2020-11-09  8:13 ` xuchunmei at linux dot alibaba.com
2020-11-09 10:30 ` nsz at gcc dot gnu.org
2020-11-09 12:53 ` xuchunmei at linux dot alibaba.com
2020-11-09 13:06 ` wdijkstr at arm dot com
2020-11-09 13:08 ` wdijkstr at arm dot com
2020-11-10  1:46 ` xuchunmei at linux dot alibaba.com
2020-11-10 12:53 ` wdijkstr at arm dot com
2022-02-23  3:22 ` yangyanchao6 at huawei dot com
2022-02-23  3:29 ` yangyanchao6 at huawei dot com
2022-03-05 19:31 ` goldstein.w.n at gmail dot com
2022-03-15 17:04 ` wdijkstr at arm dot com
2022-03-15 17:33 ` goldstein.w.n at gmail dot com
2022-03-16 18:53 ` wdijkstr at arm dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).