public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: "François Dumont" <frs.dumont@gmail.com>
To: "libstdc++@gcc.gnu.org" <libstdc++@gcc.gnu.org>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: [PATCH] Enhance _Hashtable for range insertion 0/5
Date: Mon, 20 Jun 2022 18:57:19 +0200	[thread overview]
Message-ID: <8df25ff1-5b70-4030-768b-965f92870eb9@gmail.com> (raw)

Hi

Here is a series of patch to enhance _Hashtable behavior mostly in the 
context of range insertion. I also start considering the problem of 
memory fragmentation in this container with 2 objectives:

- It is easier to find out when you're done with the elements of a 
bucket if the last node of the bucket N is the before-begin node of 
bucket N + 1.

- It is faster to loop through nodes of a bucket if those node are close 
in memory, ultimately we should have addressof(Node + 1) == 
addressof(Node) + 1

[1/5] Make more use of user hints as both insertion and allocation hints.

[2/5] Introduce a new method to check if we are still looping through 
the same bucket's nodes

[3/5] Consider that all initializer_list elements are going to be inserted

[4/5] Introduce a before-begin cache policy to remember which bucket is 
currently pointing on it

[5/5] Prealloc nodes on _Hashtable copy and introduce a new assignment 
method which replicate buckets data structure

François


             reply	other threads:[~2022-06-20 16:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-20 16:57 François Dumont [this message]
2022-06-21 17:12 ` Jonathan Wakely
2022-06-26 20:06   ` François Dumont
2022-06-27 16:18     ` 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=8df25ff1-5b70-4030-768b-965f92870eb9@gmail.com \
    --to=frs.dumont@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@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).