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
November 25, 2005 04:43
Re: XS-assisted SWASHGET (esp. for t/uni/class.t speedup)
Message ID:


Sadahiro Tomoyuki wrote:
>On Wed, 23 Nov 2005 23:06:15 +0000, Dave Mitchell <> wrote
>> On Wed, Nov 23, 2005 at 05:57:34PM +0900, SADAHIRO Tomoyuki wrote:
>> > In particular, removal of save_re_context, PUSHSTACKi and POPSTACK
>> > from Perl_swash_fetch seems to save much times.
>> As far as I can see, the PUSHSTACKi is still required, since
>> Perl_swash_fetch may extend the stack, and it is called from places
>> that may not expect the stack to be extended (and thus reallocated).

First: You are my hero! Yeah!

(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 see.
>There is a patch below, which makes PUSHSTACKi and POPSTACK come back.
>(This patch also includes document fix. The lib/unicore/* files are
>loaded from SWASHNEW, by the sentence of < $list = do $file; >)

>> Also, I don't understand why SWASHGET remains as a perl-level function
>> that just calls the XS utf8::SWASHGET_heavy; why not just rename
>> utf8::SWASHGET_heavy to utf8::SWASHGET ?

>The argument DEBUG of utf8::SWASHGET_heavy may be unnecessary
>if people need not the "debug" information from SWASHGET
>or utf8::DEBUG subroutine is called from XS.
>(I think the debug codes in SWASHGET_heavy are quite redundant.)
>For a furthur advance, I wonder why we need call SWASHGET as a method.
>The details of swashes are not (and should not be, I think) documented,
>and SWASHGET are called only from Perl_swash_fetch and SWASHGET
>itself (recursively).
>SWASHGET may expect that all the swash objects are created by
>utf8::SWASHNEW as an only constructor, and we can know the data
>structures of the return value from utf8::SWASHNEW.
>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 :)

Best wishes,


- -- 
 Signed on Fri Nov 25 13:43:24 2005 with key 0x93B84C15.
 Visit my photo gallery at
 PGP key on or per email.

 "The rovers Spirit and Opportunity were proposed, authorized, announced,
 designed, launched and successfully landed upon Mars within the
 timeframe of Duke Nukem Forever's development." - Unknown

Version: GnuPG v1.2.4 (GNU/Linux)


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About