public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: "François Dumont" <frs.dumont@gmail.com>
Cc: Paolo Carlini <paolo.carlini@oracle.com>,
		"libstdc++@gcc.gnu.org" <libstdc++@gcc.gnu.org>,
	gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [v3] Fix management of non empty hash functor
Date: Mon, 28 Jan 2013 15:43:00 -0000	[thread overview]
Message-ID: <CAH6eHdSDudjKVi=DeLPwE5X1_sp5-G7g2Qe9xq5obQ+V=ntM_A@mail.gmail.com> (raw)
In-Reply-To: <50EF2C6F.3050609@gmail.com>

On 10 January 2013 21:02, François Dumont wrote:
> Hi
>
>     Here is an other version of this patch. Indeed there were no need to
> expose many stuff public. Inheriting from _Hash_code_base is fine, it is not
> final and it deals with EBO itself. I only kept usage of
> _Hashtable_ebo_helper when embedding H2 functor. As it is an extension we
> could have impose it not to be final but it doesn't cost a lot to deal with
> it. Finally I only needed a single friend declaration to get access to the
> H2 part of _Hash_code_base.

OK.

>     I didn't touch the default cache policy for the moment except reducing
> constraints on the hash functor. I prefer to submit an other patch to change
> when we cache or not depending on the hash functor expected performance.

OK.  The reduced constraints are good.  Does this actually affect
performance?  In my tests it doesn't, so I assume we still need to
change the caching decision to notice any performance improvements?

(Do the performance benchmarks actually tell us anything useful?
When I run them I get such varying results it doesn't seem to be reliable.)

>     I also took the time to replace some typedef expressions with using
> ones. I really know what is the rule about using one or the other but I
> remembered that Benjamin spent quite some time changing typedef in using so
> I prefer to stick to this approach in this file, even if there are still
> some typedef left.

OK, that doesn't make any difference so isn't important which is used.


>     Tested under linux x86_64 normal and debug modes.
>
> 2013-01-10  François Dumont  <fdumont@gcc.gnu.org>
>
>
>     * include/bits/hashtable_policy.h (_Local_iterator_base): Use
>     _Hashtable_ebo_helper to embed necessary functors into the
>     local_iterator when necessary. Pass information about functors

Repeating "necessary" seems unnecessary here :)

>     involved in hash code by copy.
>     * include/bits/hashtable.h (__cache_default): Do not cache for
>     builtin integral types unless the hash functor is not noexcept
>     qualified or is not default constructible. Adapt static assertions
>     and local iteraror instantiations.

^^ "iteraror"

+      // When hash codes are not cached local iterator inherits from
+      // __hash_code_base above to compute node bucket index so it has to be
+      // default constructible.
+      static_assert(__if_hash_not_cached<
+		      is_default_constructible<__hash_code_base>>::value,
+		    "Cache the hash code or make functors involved in hash code"
+		    " and bucket index computation default constructibles");

"constructible" not "constructibles"

This is OK for trunk, but not 4.7

  reply	other threads:[~2013-01-28 15:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-13 21:33 François Dumont
     [not found] ` <50E6BA2C.2060109@oracle.com>
2013-01-10 21:02   ` François Dumont
2013-01-28 15:43     ` Jonathan Wakely [this message]
2013-01-28 21:08       ` François Dumont
2013-01-28 21:12         ` Jonathan Wakely

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='CAH6eHdSDudjKVi=DeLPwE5X1_sp5-G7g2Qe9xq5obQ+V=ntM_A@mail.gmail.com' \
    --to=jwakely.gcc@gmail.com \
    --cc=frs.dumont@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    --cc=paolo.carlini@oracle.com \
    /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).