shopsuite-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ShopSuite-dev] [rational type] X/1 --> X


From: Tomasz Wegrzanowski
Subject: Re: [ShopSuite-dev] [rational type] X/1 --> X
Date: Sun, 9 Sep 2001 20:16:25 +0200
User-agent: Mutt/1.3.20i

On Sun, Sep 09, 2001 at 06:45:38PM +0100, Davi Leal wrote:
> Tomasz Wegrzanowski wrote:
> 
> > On Sun, Sep 09, 2001 at 04:29:22PM +0100, Davi Leal wrote:
> > > Tomasz Wegrzanowski wrote:
> > >
> > > > > Please, send me it.
> > > >
> > > > Here they are:
> > > >     rx.c        -       posix rx
> > > >     pcre.c      -       perl rx via posix rx api
> > >
> > > I attach you the new rational/rational.c and rational/test.sql files. Run 
> > > 'psql shop <
> > > test.sql' and 'cvs diff rational.c'. If you think all is correct I will 
> > > add/commit it
> > > today.
> >
> > Problems with this file:
> > * rx is compiled on every run, not just once.
> >   Compiling it once will speed thing up.
> > * using rx will surely slow thing down by order of magnitude anyway.
> >
> > A benchmark (128k function calls, Athlon 1 GHz, average 3 runs):
> > with rx, compile multiple:      3.71 sec
> > with rx, compile once:          0.46 sec
> > without rx:                     0.11 sec
> >
> > So as a minimum, this code should be used:
> >     static regex_t preg;
> >     static int compiled = 0;
> >
> >     if (compiled == 0) {
> >         if (regcomp(&preg, regex, REG_NOSUB) != 0)
> >             RETURN_UNDEF(result);
> >         compiled = 1;
> >     }
> 
> Thanks. Execute 'cvs diff rational.c' using the attached file. Is it right 
> now?.

You have misconfigured mail agent. It sent rational.c as image/x-bitmap.
As sgn is bool, true/false, not 1/0 should be used.
Otherwise, new rational.c seems ok, and it passed test.sql

Oh, and I'm not sure if compile version is multithread-ok, or some mutex should
be used :(

> > > P.D.: Could you design and develop the modification of 
> > > 'rational/Makefile' so as to
> > > add the 'make test' line?. I think you will realize it easier than me. -- 
> > > If you
> > > agree, please send it so that I can commit it.
> >
> > There are some problems with `make test':
> > * how to reload pg from makefile, we could just assume we're running debian
> >   and ask for root passwd ?
> 
> > * what database is used for testing ?
> 
> Uhmm. Too much complex. Forbide it. I will add a 'test' to the doc/TODO file 
> to check the
> rational pluggin by hand. What do you think?
> 
> -- doc/TODO
> * rational plug-in test
>   # This test assume that the PostgreSQL and rational plug-in
>   # installation is correct and that there is a shop data base. See the
>   # /README file to realize it.
>   psql shop < test.sql
>   # Inspect the output by hand

You didn't read the output, did you ?

* rational plug-in test
  # This test assume that the PostgreSQL and rational plug-in
  # installation is correct and that there is a shop data base. See the
  # /README file to realize it.
  psql shop < test.sql > real.out
  diff -u expected.out real.out
  # Inspect the output by hand



reply via email to

[Prev in Thread] Current Thread [Next in Thread]