develooper Front page | perl.perl5.porters | Postings from November 2005

Re: XS-assisted SWASHGET (esp. for t/uni/class.t speedup)

Thread Previous | Thread Next
From:
Steve Peters
Date:
November 27, 2005 19:52
Subject:
Re: XS-assisted SWASHGET (esp. for t/uni/class.t speedup)
Message ID:
20051128035205.GA17091@mccoy.peters.homeunix.org
On Sun, Nov 27, 2005 at 01:20:55PM +0900, SADAHIRO Tomoyuki wrote:
> > (Btw, is the performance improvement after I rewrote t/uni/class.t or 
> > after? I guess afterwards it is a bit lower but this is more because 
> > class.t did less work (maybe calling swashget less often).
> 
> I took frequency of calling functions [table 1] and time [table 2]
> during running t/uni/class.t.
> 
> class.t(curr.) is that in perl-current and
> class.t(old) is that before Change 25020 by Tels.
> 
> [table 1]
>                                       class.t(curr.)   class.t(old)
> call swash_fetch (total)              2389418 times    2389418 times
> use PL_last_swash_## (global cache)   2348218          2348218
> use internal cache kept in swash        15357               85
> create new swatch via swashget          25843            41115
> 
> *Certainly Tels' patch diminished the frequency of calling swashget.
> 
> [table 2]
>                                        class.t(curr.)  class.t(old)
> SWASHGET in XS,  /*save_re_context*/     12-12 sec      12-12 sec
> SWASHGET in XS,    save_re_context       25-28          39-43
> SWASHGET in perl,  save_re_context       32-34          54-56
> (swash_get in C, /*save_re_context*/     11-12          11-12 )
> 
> These results are rough (just by using CORE::time() twice)
>               and relative (must depend on machine spec).
> 
> save_re_context surrounded by /* */ (comment for C) means
> that calling SWASHGET or swash_get does not accompany
> calling save_re_context.
> 
> >>Parhaps SWASHGET may be able to recast as a C-level function
> >>rather than XS. For example,
> 
> > I'd like to see that implemented. Cutting out one layer of subroutine 
> > indirection can't hurt :)
> 
> perhaps soon..
> 

When I applied the patch locally, I got the following warnings.

> make utf8.o
`sh  cflags "optimize='-O2'" utf8.o`  utf8.c
          CCCMD =  cc -DPERL_CORE -c -DPERL_PATCHNUM=26219 -fno-strict-aliasing -pipe -I/usr/local/include -O2  -Wall
utf8.c: In function `S_swash_get':
utf8.c:1764: warning: long unsigned int format, STRLEN arg (arg 2)
utf8.c:1800: warning: `val' might be used uninitialized in this function

Steve Peters
steve@fisharerojo.org

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About