From: Noah Lavine <noah.b.lavine@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guile-devel@gnu.org
Subject: Re: rfi: hash set
Date: Wed, 19 Jan 2011 21:11:07 -0500 [thread overview]
Message-ID: <AANLkTikTADT+0TpmpcmkQbndT8vbYfCuHRraAFEyzM=e@mail.gmail.com> (raw)
In-Reply-To: <87r5cbi5l7.fsf@gnu.org>
Hello again,
Actually, I need to retract what I said before. Here is what I think
is actually going on, and it means that the current code is correct.
min_size_index will usually be 0, which means the table can shrink
down to the minimum hash table size (31). The only case it won't be 0
is if the hash table was created by passing a size argument to
make-hash-table, in which case min_size_index will be whatever it
needs to be so that the table will never shrink below the size
specified to make-hash-table. This is consistent with the
documentation, which says that a table created with a given size will
always be at least that large.
Sorry about that. I'll work on hash sets now.
Noah
On Mon, Jan 17, 2011 at 4:27 PM, Ludovic Courtès <ludo@gnu.org> wrote:
> Hi Noah!
>
> Noah Lavine <noah.b.lavine@gmail.com> writes:
>
>> I started looking into implementing this, and I ran into something
>> strange that I'd like clarification on. Am I correct in saying that
>> currently, hash tables can only shrink by one size index when they are
>> rehashed?
>
> Yes, your analysis looks correct to me. Would you like to look into
> fixing this? :-)
>
> I suppose the trick would be to regularly recompile ‘min_size_index’
> based on the current ‘SCM_HASHTABLE_N_ITEMS’, iterating on
> HASHTABLE_SIZE, starting from the current ‘min_size_index’.
>
> Thanks,
> Ludo’.
>
>
>
prev parent reply other threads:[~2011-01-20 2:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-06 3:56 rfi: hash set Andy Wingo
2011-01-15 1:42 ` Noah Lavine
2011-01-17 21:27 ` Ludovic Courtès
2011-01-20 2:11 ` Noah Lavine [this message]
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
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='AANLkTikTADT+0TpmpcmkQbndT8vbYfCuHRraAFEyzM=e@mail.gmail.com' \
--to=noah.b.lavine@gmail.com \
--cc=guile-devel@gnu.org \
--cc=ludo@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).