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: Davi Leal
Subject: Re: [ShopSuite-dev] [rational type] X/1 --> X
Date: Sun, 09 Sep 2001 18:45:38 +0100

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?.



> > 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

X bitmap


reply via email to

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