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
Avoiding shared data
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Brian Hurt <bhurt@s...>
Subject: Re: [Caml-list] Avoiding shared data

On Tue, 4 Oct 2005, skaller wrote:

> Mutable shared data is very useful: caching is
> an obvious example where this is precisely what you want.

Also, occassionally mutable data allows you to do something in O(1) 
instead of O(log N).  If this extra cost is in your inner loop, it can 
slow the whole algorithm down by a factor of 10-30 fold easy.  Graph 
algorithms are especially bad for this.  Want to get a name for yourself? 
Come up with a way to represent cyclic graphs in a purely functional way 
such that given any arbtirary node, I can find out what other nodes it has 
edges to (and what their weights are) in O(1).