From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id DCF8EBC6B for ; Mon, 11 Feb 2008 13:41:55 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAKPRr0fAXQImh2dsb2JhbACQOQEBAQgKKZZQ X-IronPort-AV: E=Sophos;i="4.25,333,1199660400"; d="scan'208";a="7161364" Received: from discorde.inria.fr ([192.93.2.38]) by mail2-smtp-roc.national.inria.fr with ESMTP; 11 Feb 2008 13:41:55 +0100 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id m1BCftda013224 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Mon, 11 Feb 2008 13:41:55 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CACvRr0fUVZgL/2dsb2JhbACnRg X-IronPort-AV: E=Sophos;i="4.25,333,1199660400"; d="scan'208";a="9025960" Received: from hades.snarc.org ([212.85.152.11]) by mail3-smtp-sop.national.inria.fr with ESMTP; 11 Feb 2008 13:41:55 +0100 Received: by hades.snarc.org (Postfix, from userid 1000) id 2875F1B482; Mon, 11 Feb 2008 13:41:53 +0100 (CET) Date: Mon, 11 Feb 2008 13:41:53 +0100 To: Jean-Christophe =?iso-8859-1?Q?Filli=E2tre?= Cc: Oliver Bandel , caml-list@inria.fr Subject: Re: [Caml-list] Now it's faster (addendum to "Performance-question") Message-ID: <20080211124153.GB10096@snarc.org> References: <1202297628.47a99b1c7ec53@webmail.in-berlin.de> <1202298904.47a9a018998e4@webmail.in-berlin.de> <20080206120403.GA5335@snarc.org> <47B01D01.7040509@lri.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <47B01D01.7040509@lri.fr> X-Warning: Email may contain unsmilyfied humor and/or satire. User-Agent: Mutt/1.5.16 (2007-06-11) From: tab@snarc.org (Vincent Hanquez) X-Miltered: at discorde with ID 47B04293.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; 0100,:01 filliatre:01 buffer:01 ocaml's:01 buffer:01 ocaml:01 integers:01 runtime:01 cheers:01 wrote:01 wrote:01 caml-list:01 int:01 argument:02 argument:02 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) Cheers, -- Vincent Hanquez