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.1 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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id AE6AABC6C for ; Thu, 7 Feb 2008 10:55:38 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAMlkqkfAXQImh2dsb2JhbACQMgEBAQgKKZtg X-IronPort-AV: E=Sophos;i="4.25,315,1199660400"; d="scan'208";a="7757618" Received: from discorde.inria.fr ([192.93.2.38]) by mail1-smtp-roc.national.inria.fr with ESMTP; 07 Feb 2008 10:55:38 +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 m179tccI011279 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Thu, 7 Feb 2008 10:55:38 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAENkqkfBMVMQk2dsb2JhbACQMgEBAQEHBAYJIJtg X-IronPort-AV: E=Sophos;i="4.25,315,1199660400"; d="scan'208";a="8900848" Received: from minbis.univ-orleans.fr (HELO min.univ-orleans.fr) ([193.49.83.16]) by mail3-smtp-sop.national.inria.fr with ESMTP; 07 Feb 2008 10:55:38 +0100 Received: from smtps.univ-orleans.fr (localhost [127.0.0.1]) by min.univ-orleans.fr (Postfix) with ESMTP id 0E8D112B3F7; Thu, 7 Feb 2008 10:55:38 +0100 (CET) Received: from [192.168.0.1] (lau18-1-82-246-197-195.fbx.proxad.net [82.246.197.195]) by smtps.univ-orleans.fr (Postfix) with ESMTP id 5D1D436E5B; Thu, 7 Feb 2008 10:55:38 +0100 (CET) Subject: Re: [Caml-list] Now it's faster (addendum to "Performance-question") From: David Teller To: Vincent Hanquez Cc: Oliver Bandel , caml-list@inria.fr In-Reply-To: <20080206120403.GA5335@snarc.org> References: <1202297628.47a99b1c7ec53@webmail.in-berlin.de> <1202298904.47a9a018998e4@webmail.in-berlin.de> <20080206120403.GA5335@snarc.org> Content-Type: text/plain Date: Thu, 07 Feb 2008 10:55:34 +0100 Message-Id: <1202378134.6444.1.camel@Blefuscu> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 47AAD59A.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; univ-orleans:01 buffer:01 cheers:01 0100,:01 buffer:01 appending:01 univ-orleans:01 lifo:01 liquidations:98 wrote:01 caml-list:01 data:02 data:02 string:02 string:02 A possible improvement of the buffer library (along with a ropes library) may be a good future subject for OSR. Well, once we have answered the already-asked questions, of course. Cheers, David On Wed, 2008-02-06 at 13:04 +0100, Vincent Hanquez wrote: > well i'm pretty sure you could go down even further with your own > implementation of a buffer library. > > the buffer library is actually pretty bad since it's actually just a > simple string. each time the buffer need to grow, the string is > reallocated and the previous one is copied to the new string. > and you got the 16mb limit (max_string_length) on 32bit. > > if you implement a growing array of fixed sized string (4K for example), > you just don't need to copy data each time your buffer need to grow. I > suspect it might be even faster than the normal buffer in your case > (lots of data appending), but depends on what you do with your buffer > afterwards. > -- David Teller Security of Distributed Systems http://www.univ-orleans.fr/lifo/Members/David.Teller Angry researcher: French Universities need reforms, but the LRU act brings liquidations.