English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Now it's faster (addendum to "Performance-question")
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-02-11 (12:41)
From: tab@s...
Subject: Re: [Caml-list] Now it's faster (addendum to "Performance-question")
On Mon, Feb 11, 2008 at 11:01:37AM +0100, Jean-Christophe Filliâtre wrote:
> Just for fun, I wrote a ropes-based implementation of Buffer. The
> interface is exactly the same. Differences between the two
> implementations are the following:
>  - Contrary to ocaml's standard library, a buffer size is not limited to
>       [Sys.max_string_length], but to [max_int] (sizes are represented
>       internally using native ocaml integers).
>  - [contents] and [sub] raise [Invalid_argument] if the resulting string
>       would be larger than [Sys.max_string_length] bytes.
>  - The meaning of [create]'s argument is not exactly the same,
>     though its value only affects performances, as for [Buffer];
>     see below.
>  - An additional function [print] is provided.

that's nice. how's the performance compare to plain buffer ?

one nit, keeping compatibility is good, however, the contents function
is quite evil (runtime failure), and removing it would be nice as well.
people should use other thing to "iterate" over the contents (even if
contents is quite practical)

Vincent Hanquez