caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Alex Baretta <alex@baretta.com>
To: Jan Kybic <kybic@fel.cvut.cz>
Cc: caml-list@pauillac.inria.fr
Subject: Re: [Caml-list] Re: Q: automatic forgetting cache, module Weak, Gc control
Date: Thu, 01 Jul 2004 20:14:06 +0200	[thread overview]
Message-ID: <40E4546E.70005@baretta.com> (raw)
In-Reply-To: <m2n02j3daj.fsf_-_@fel.cvut.cz>

Jan Kybic wrote:

> I am also thinking about other strategies taking into account the
> sizes of the produced results. In this case the global structure would
> be an ordered set.
> 
> The disadvantage of putting the values into two structures is the
> memory overhead. Maybe I should avoid using Weak hashtables
> alltogether and store the values in a set of normal hashtables,
> dropping some of them, if necessary... It is difficult to get the
> memory/speed tradeoff right.

You can memoize your results in a generic manner through the use of maps 
which use result hashes as keys. Two results hashing down to the same 
value will not be stored in the same map. The number of significant bits 
used by the hash function determines the size of the map.

Alex

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2004-07-01 18:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-30 11:05 [Caml-list] " Jan Kybic
2004-07-01  8:43 ` Jacques GARRIGUE
2004-07-01 13:59   ` skaller
2004-07-01 16:25     ` [Caml-list] " Jan Kybic
2004-07-01 18:14       ` Alex Baretta [this message]
2004-07-02  8:53       ` Hendrik Tews
2004-07-02  9:40         ` Jan Kybic

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=40E4546E.70005@baretta.com \
    --to=alex@baretta.com \
    --cc=caml-list@pauillac.inria.fr \
    --cc=kybic@fel.cvut.cz \
    /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).