English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] why does hashtbl not use lists?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-07-11 (15:54)
From: Xavier Leroy <xleroy@p...>
Subject: Re: [Caml-list] why does hashtbl not use lists?
> I thought about mentioning the time saving from the reduced number of
> allocations, but then I wondered whether it would really save any time.
> If you have a compacting garbage collector, as I'm pretty sure Ocaml does,
> and a good compiler, then the compiler would be able to combine the two
> allocations into a single one.  Does Ocamlopt do that?

Yes, it does.  Still, you save two stores at allocation time with the
flat representation -- in addition to the more significant time
savings at access time (one fewer indirection).

- Xavier Leroy
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr