From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,a65bb7bde679ed1d X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.35.68 with SMTP id f4mr32457304pbj.5.1322586530153; Tue, 29 Nov 2011 09:08:50 -0800 (PST) Path: lh20ni38459pbb.0!nntp.google.com!news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Tue, 29 Nov 2011 18:08:46 +0100 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ann: Natools.Chunked_Strings, beta 1 References: <4ed4fc37$0$2537$ba4acef3@reader.news.orange.fr> In-Reply-To: Message-ID: <4ed5119e$0$7619$9b4e6d93@newsspool1.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 29 Nov 2011 18:08:46 CET NNTP-Posting-Host: cfa904f4.newsspool1.arcor-online.net X-Trace: DXC=EjLh>_cHTX3jmWdI6h X-Complaints-To: usenet-abuse@arcor.de Xref: news1.google.com comp.lang.ada:19242 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Date: 2011-11-29T18:08:46+01:00 List-Id: On 29.11.11 17:34, Natasha Kerensikova wrote: > Hello, > > On 2011-11-29, Pascal Obry wrote: >> Do you have some speed/memory comparison between your Chunked_String and >> GNAT Unbounded_String? > > Not yet, but I would love to eventually have it. I'm mostly missing a > proper benchmark protocol, and any input on that point would be > appreciated. The package GNAT.Spitbol.Patterns uses Unbounded_String extensively. Last time I checked it seemed possible to replace the dependence on Ada.Strings.Unbounded with one on a compatible package. The very first definition in GNAT.Spitbol is subtype VString is Ada.Strings.Unbounded.Unbounded_String; It should be sufficient to change this definition and Nul : VString renames Ada.Strings.Unbounded.Null_Unbounded_String; to use your strings, in local copies of the sources of the GNAT.Spitbol hierarchy. Of particular interest might be, I think, anything that can improve replacement in objects of type Unbounded_String. One program whose performance depends a lot on replacement in Unbounded_String is http://shootout.alioth.debian.org/u32q/program.php?test=regexdna&lang=gnat&id=1 The bencher software they use to measure relative performance of the programs is fairly easy to install on GNU/Linux. The "read-only" part of the above program is really fast, the replacements, however, aren't. The critical part is in the function Match: -- Perform the regex substitution. Likely facing -- -- (1a) the GREAT BIG subtstitution problem -- (cf. D.W.E. Blatt, 1980) -- (1b) replacements in Unbounded_String which -- the pattern matching implementation is using while I <= Limit loop for C in Codes_Index loop while Match(Subject => Sequence_Lines(I), Pat => Codes(C).Code, Replace => Codes(C).Alternatives) loop null; end loop; end loop; I := I + Step; end loop; Maybe you find some idea in there to be useful for testing.