public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "neleai at seznam dot cz" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug libc/15884] Big performance problem in strcoll
Date: Fri, 23 Aug 2013 18:26:00 -0000	[thread overview]
Message-ID: <bug-15884-131-H6vNkxy53C@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-15884-131@http.sourceware.org/bugzilla/>

http://sourceware.org/bugzilla/show_bug.cgi?id=15884

Ondrej Bilka <neleai at seznam dot cz> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |---
            Summary|Big performance regression  |Big performance problem in
                   |in strcoll                  |strcoll

--- Comment #3 from Ondrej Bilka <neleai at seznam dot cz> ---
I thougth that originaly a comparison was done character-by-character without
useless allocation, after looking through history I was mistaken. Changing
regression->problem.

> Also, the test case is invalid.  It compares a space with an exclamation  
> point, both of which are ignored as collation sequences due to which the 
> algorithm actually goes through all the passes for the string before it 
> compares them on a binary level.  Replace 32 and 33 with 'a' and 'b' and 
> you'll see the difference.

it is still there, just smaller multiplicative factor hidden it into loop
overhead for smaller lengths. When changed to a/b time becomes:

ondra@neklekam:~$ gcc -DN=1 strcoll.c ; time ./a.out

real    0m0.040s
user    0m0.037s
sys    0m0.000s

ondra@neklekam:~$ gcc -DN=10 strcoll.c ; time ./a.out

real    0m0.039s
user    0m0.037s
sys    0m0.003s
ondra@neklekam:~$ gcc -DN=100 strcoll.c ; time ./a.out

real    0m0.044s
user    0m0.043s
sys    0m0.007s
ondra@neklekam:~$ gcc -DN=1000 strcoll.c ; time ./a.out

real    0m0.115s
user    0m0.113s
sys    0m0.000s
ondra@neklekam:~$ gcc -DN=10000 strcoll.c ; time ./a.out

real    0m0.737s
user    0m0.737s
sys    0m0.000s
ondra@neklekam:~$ gcc -DN=100000 strcoll.c ; time ./a.out

real    0m7.443s
user    0m7.443s
sys    0m0.000s

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


  parent reply	other threads:[~2013-08-23 18:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-23 16:38 [Bug libc/15884] New: Big performance regression " neleai at seznam dot cz
2013-08-23 17:29 ` [Bug libc/15884] " siddhesh at redhat dot com
2013-08-23 17:52 ` siddhesh at redhat dot com
2013-08-23 18:26 ` neleai at seznam dot cz [this message]
2013-08-24  3:48 ` [Bug libc/15884] Big performance problem " siddhesh at redhat dot com
2013-08-24  5:33 ` neleai at seznam dot cz
2013-08-24 20:20 ` bugdal at aerifal dot cx
2014-06-13 13:04 ` fweimer at redhat dot com
2014-10-17 10:19 ` cvs-commit at gcc dot gnu.org
2014-11-25 23:03 ` neleai at seznam dot cz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-15884-131-H6vNkxy53C@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).