Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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:  FAQ:
To unsubscribe, mail  Archives: