caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Damien Doligez <damien.doligez@inria.fr>
To: caml-list <caml-list@inria.fr>
Subject: Re: AW: [Caml-list] generic Hashtbl.to_array
Date: Wed, 26 Jul 2006 11:46:34 +0200	[thread overview]
Message-ID: <537FA1A3-6DF3-439A-AA9E-F75B6D1BFF81@inria.fr> (raw)
In-Reply-To: <26EB47FDD566A7469FC862DAF373792F017112AD@kaiserslautern1.lmsintl.com>


On 2006-07-25, at 14:44, Christoph Bauer wrote:

>>
>> let to_array_4 t =
>>    let init = ref None in
>>    begin try Hashtbl.iter (fun k v -> init := Some (k,v);
>> raise Exit) t
>
> My guess: hashtbl has to loop over the first empty buckets.
> And this eats the cpu cycles.

I guess that's correct, since you're doing your tests with a
100000-sized hash table that contains only one entry. I wouldn't
call that a typical case.

-- Damien


  parent reply	other threads:[~2006-07-26  9:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-25 12:44 Christoph Bauer
2006-07-25 15:20 ` Tom
2006-08-15  8:08   ` Stéphane Glondu
2006-07-26  9:46 ` Damien Doligez [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-07-26 14:41 AW: " Christoph Bauer
2006-07-26  9:29 Christoph Bauer
2006-07-25 15:53 AW: " Christoph Bauer
2006-07-25 16:35 ` Tom
2006-07-25 15:34 Christoph Bauer
2006-07-25 10:19 Christoph Bauer
2006-07-25 10:45 ` skaller

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=537FA1A3-6DF3-439A-AA9E-F75B6D1BFF81@inria.fr \
    --to=damien.doligez@inria.fr \
    --cc=caml-list@inria.fr \
    /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 NNTP newsgroup(s).