Version française
Home     About     Download     Resources     Contact us    
Browse thread
Impact of GC on memoized algorithm
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Alex Baretta <alex@b...>
Subject: Re: [Caml-list] Impact of GC on memoized algorithm
Jon Harrop wrote:
> On Wednesday 30 March 2005 09:39, Alex Baretta wrote:
> 
>>I have come to think that the difference in performance might be
>>attributable to the garbage collector.
> 
> 
> Try to objectively quantify the performance bottleneck using profiling, rather 
> than speculating. Most of the time, most of the people speculate 
> incorrectly. :-)

Might be. I'm just trying to analyze critically my own work.

> In this case, if you are using an inappropriate data structure as the key to 
> the hash table then you may be getting a lot of clashes. In which case, lots 
> of time will be spent looking up elements in hash table's own list 
> implementation. IIRC, most of the time will then be spent in the 
> Hashtbl.find_rec function...

This is rather unlikely. The key to the hashtable is a unique integer...

Rather, what happens, time-wise, if I create a hashtable with 4096 slots 
and end up filling it with several million key-value pairs?

Alex

-- 
*********************************************************************
http://www.barettadeit.com/
Baretta DE&IT
A division of Baretta SRL

tel. +39 02 370 111 55
fax. +39 02 370 111 54

Our technology:

The Application System/Xcaml (AS/Xcaml)
<http://www.asxcaml.org/>

The FreerP Project
<http://www.freerp.org/>