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] Cross-platform DBM equivalent?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Pierre Weis <pierre.weis@i...>
Subject: Re: [Caml-list] Cross-platform DBM equivalent?
> Pierre Weis <> writes:
> >   As far as I know the best (and simpler) way to do this for reasonable
> >   number of URLs bindings (say thousands but not millions) is to create
> >   a Hashtlbl.t or Map.t and dump it to file using output_value (then
> >   read it back with input_value).
> Is there a recommended data structure in case one needs tables for
> reasonably fast access to millions or tens of millions of values?
> Probably hash tables are no longer providing nearly-constant access
> time at those sizes.  Is there something better in the standard
> library?   
> Thanks --
>         Joshua 

You need to try :) I think that hash table and maps can handle
tens of millions of values if you have enough memory available. If
your hash tables are big enough and if your keys are reasonably
different strings, hash table will still give you nearly-constant
access time.

If you have not enough memory, you should consider mmap facilities
from the Bigarray module (memory mapping of files, accessed from the
disk by need when a given page is indeed accessed by the

All the best for the next year!

Pierre Weis

INRIA, Projet Cristal,,

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: