Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Lazy vs closure
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Kenneth Knowles <kknowles@b...>
Subject: [Caml-list] Re: Lazy vs closure

Your test_lazy creates a new lazy value each time.  The thing that might make
Lazy faster than closure (or rather, _should_ make it faster) is if you evaluate
the same value multiple times, because it is only computed once.  The slowdown
compared to closures is probably the bookkeeping necessary for this memoizing.

Kenn

On Tue, May 18, 2004 at 11:21:57PM -0700, Vladimir N. Silyaev wrote:
> After reading list and seeing statement that lazy/Lazy.force is faster then
> closure/apply, I've decided to run microbenchmark with both.
> Results are rather confusing:
>  Byte code - Lazy is three times slower than closure
>  Native code (x86) - it's either coredumps or leaks memory

-------------------
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