public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "marc.glisse at normalesup dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/50160] vector<bool> comparison very slow (no specialisation)
Date: Tue, 23 Aug 2011 18:47:00 -0000	[thread overview]
Message-ID: <bug-50160-4-uvqI2HeLMp@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-50160-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50160

--- Comment #7 from Marc Glisse <marc.glisse at normalesup dot org> 2011-08-23 18:35:57 UTC ---
If I understand correctly, operator< is supposed to give a lexicographic order,
and vector<bool> stores {true,false,false} as 1 and {false,false,true} as 4, so
we can't just make operator< compare chunks. Reversing the order of the bits in
an unsigned long is a bit complicated, although it would still lead to code
faster than the current (easiest would be to compare byte by byte, and mirror
each byte using a table).

But you don't seem particularly interested in using the lexicographic order, is
that true? In that case you could try and specify some other order to std::map,
say comparing hashes ;-) I understand that the lexicographic order of the
chunks would be a fine order, but I don't think it can be exposed. I haven't
thought about the potential drawbacks of implementing vector<bool> backwards.


  parent reply	other threads:[~2011-08-23 18:36 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-23  1:15 [Bug libstdc++/50160] New: " devel@the-user.org
2011-08-23  8:21 ` [Bug libstdc++/50160] " paolo.carlini at oracle dot com
2011-08-23 14:14 ` devel@the-user.org
2011-08-23 16:39 ` paolo.carlini at oracle dot com
2011-08-23 18:27 ` devel@the-user.org
2011-08-23 18:29 ` devel@the-user.org
2011-08-23 18:36 ` devel@the-user.org
2011-08-23 18:47 ` marc.glisse at normalesup dot org [this message]
2011-08-23 19:10 ` devel@the-user.org
2011-08-23 19:15 ` devel@the-user.org
2011-08-23 19:17 ` devel@the-user.org
2011-08-23 19:28 ` marc.glisse at normalesup dot org
2011-08-23 19:54 ` devel@the-user.org
2011-08-30 10:48 ` [Bug libstdc++/50160] vector<bool> comparison very slow (no overload) paolo.carlini at oracle dot com
2011-08-30 23:31 ` devel@the-user.org
2011-08-30 23:35 ` devel@the-user.org
2011-08-30 23:35 ` devel@the-user.org
2011-08-30 23:40 ` redi at gcc dot gnu.org
2011-08-31  0:05 ` devel@the-user.org
2011-08-31  0:12 ` paolo.carlini at oracle dot com
2011-08-31  0:34 ` paolo.carlini at oracle dot com
2011-08-31  0:34 ` devel@the-user.org
2011-08-31  0:40 ` pinskia at gcc dot gnu.org
2011-08-31  0:41 ` devel@the-user.org
2011-08-31  0:53 ` devel@the-user.org
2011-08-31  1:10 ` paolo.carlini at oracle dot com
2011-08-31 15:28 ` joseph at codesourcery dot com
2011-09-22  9:35 ` marc.glisse at normalesup dot org
2011-09-22  9:55 ` paolo.carlini at oracle dot com
2011-09-22 10:44 ` marc.glisse at normalesup dot org
2011-09-22 14:17 ` devel@the-user.org
2012-03-13  8:30 ` DANISH8926536 at GMAIL dot COM
2012-03-29 10:45 ` ptim034 at gmail dot com
2012-10-31 11:10 ` muhammadali.ca4 at gmail dot com
2012-12-21  6:46 ` muhammadali.ca4 at gmail dot com
2012-12-21 11:58 ` muhammadali.ca4 at gmail dot com
2013-04-30 12:30 ` dparker1324 at gmail dot com
2013-05-17  5:58 ` amandalionard at gmail dot com
2013-12-14 11:06 ` tysonroy at yopmail dot fr
2014-02-25 12:19 ` margaretnemon at gmail dot com
2014-04-09  5:41 ` elizbathjames at gmail dot com
2014-05-21  9:06 ` feritzpowell at gmail dot com
2015-08-30  8:27 ` 100adult at armyspy dot com
2015-08-30  8:27 ` 100adult at armyspy dot com

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-50160-4-uvqI2HeLMp@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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).