From: jonathan <johnscpg@googlemail.com>
Subject: Re: GNAT's stack checking in Ubuntu 9.04 (and Shootout regex-dna)
Date: Mon, 10 Aug 2009 13:12:58 -0700 (PDT)
Date: 2009-08-10T13:12:58-07:00 [thread overview]
Message-ID: <9adb4985-582c-4cbf-906c-3afa7dcd31f6@g1g2000vbr.googlegroups.com> (raw)
In-Reply-To: 4a7f1fc5$0$31344$9b4e6d93@newsspool4.arcor-online.net
On Aug 9, 8:13 pm, Georg Bauhaus <rm.tsoh.plus-
bug.bauh...@maps.futureapps.de> wrote:
I was going to give up on regexdna.adb, but I had to
try one last thing. (That's the trouble with these
danged benchmarks). I wanted to recompile the
GNAT.spitbol packages .. the quickest thing I could
think of was copy the source into my working directory
and rename them. GNAT.spitbol to GNAT_spitbol, and
GNAT.spitbol.patterns to GNAT_spitbol.patterns.
The advantage of this is you can modify them. The
first thing I tried worked rather well: I replaced
Stack_Size : constant Positive := 2000;
with
Stack_Size : constant Positive := 129;
in GNAT_spitbol.patterns.
The program running time (single-core) dropped from
47 seconds to 32 seconds. (You can set Stack_Size to
17, with all validity checks enabled, and still get
the right answer.) (Used the latest GNAT GPL, which
seems to have fewer optimizations disabled than
earlier GNAT's. Also, I ran it on a 3.2 GHz 4-core
INTEL .. faster than the one used at that
benchmarking site.)
I used gnatmake with
-O3 -gnatnp -funroll-all-loops -march=native regexdna.adb
Unfortunately, you need to do more work to
get earlier GNAT's to do this ... missing
"System.String_Hash" or something.
Last remark: someone with experience using the
spitbol routines might be able to optimize
further. There are tricks using "anchors"
mentioned in spec of GNAT.spitbol.patterns.
Jonathan
next prev parent reply other threads:[~2009-08-10 20:12 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-03 22:54 GNAT's stack checking in Ubuntu 9.04 (and Shootout regex-dna) Georg Bauhaus
2009-08-03 22:56 ` Georg Bauhaus
2009-08-04 7:50 ` Ludovic Brenta
2009-08-04 9:17 ` Georg Bauhaus
2009-08-04 9:58 ` Vadim Godunko
2009-08-04 10:44 ` Georg Bauhaus
2009-08-04 12:30 ` Vadim Godunko
2009-08-04 14:15 ` Georg Bauhaus
2009-08-04 22:20 ` Egil
2009-08-04 15:38 ` Robert A Duff
2009-08-04 11:59 ` Brian Drummond
2009-08-04 14:18 ` Georg Bauhaus
2009-08-09 19:13 ` Georg Bauhaus
2009-08-10 13:10 ` jonathan
2009-08-10 20:12 ` jonathan [this message]
2009-08-10 20:29 ` Ludovic Brenta
2009-08-10 23:34 ` Georg Bauhaus
2009-08-11 20:02 ` jonathan
2009-08-11 21:19 ` jonathan
2009-08-11 21:38 ` Georg Bauhaus
2009-08-11 0:27 ` Georg Bauhaus
2009-08-11 19:05 ` jonathan
2009-08-12 9:32 ` Ludovic Brenta
2009-08-12 16:37 ` jonathan
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox