Re: [Snowball-discuss] Local variables for snowball

From: richard@lemurconsulting.com
Date: Wed Sep 13 2006 - 18:50:09 BST


On Mon, Sep 11, 2006 at 06:53:05PM +0100, Olly Betts wrote:
> I notice the runtime functions are currently compiled without
> optimisation, which isn't good if we spend more than 1/3 of
> our time in them. I think they get built by an implicit make
> rule, so adding "-O2" to CFLAGS in GNUmakefile will do the job
> but perhaps there's some reason why it's not there?

No reason that I know. I've added it.

> Incidentally, the explicit -O4 for the generated code is a bit odd -
> there are no optimisation levels for GCC above -O3.

And, for consistency, I've changed this to -O2. This appears to give a
noticeable speed improvement on my box.

> If you really want to optimise well under GCC, it might be worth
> investigating automatically building the code with -fprofile-generate
> then running the sample word lists through, and then rebuilding with
> -fprofile-use. Trying this by running the English word list through
> stemwords gets me a 3.5% reduction in the estimated cycles from
> cachegrind.

I'm not going to add this to our current build system, since my main aim
with that is that it generates the source tarballs, etc, correctly - and
it's complex enough already. This is worth bearing in mind for anybody
using the project, though.

> Incidentally, I've also now patched the Java code generator to support
> local variables (it was easier to do than the C one actually).

Martin isn't keen on allowing the definition of snowball to be modified at
this stage, and I can see his point - there's a lot of virtue in keeping
the language definition as simple as possible. There's also something to
be said for resisting the temptation to allow the language to gradually
change - we are beginning to receive implementations of stemmers from third
parties, and making the language a moving target wouldn't help this.

Given Martin's position, I don't think we'll be including this - sorry for
wasting your time on this one.

-- 
Richard



This archive was generated by hypermail 2.1.3 : Thu Sep 20 2007 - 12:02:48 BST