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:
Tels
Date:
November 25, 2005 04:43
Subject:
Re: XS-assisted SWASHGET (esp. for t/uni/class.t speedup)
Message ID:
200511251343.36694@bloodgate.com
-----BEGIN PGP SIGNED MESSAGE-----

Moin,

Sadahiro Tomoyuki wrote:
>On Wed, 23 Nov 2005 23:06:15 +0000, Dave Mitchell <davem@iabyn.com> 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,

Tels

- -- 
 Signed on Fri Nov 25 13:43:24 2005 with key 0x93B84C15.
 Visit my photo gallery at http://bloodgate.com/photos/
 PGP key on http://bloodgate.com/tels.asc 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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iQEVAwUBQ4cG93cLPEOTuEwVAQFpigf7BptETEGsnB0plWoJLs2I8iolWLGnmUos
kpOMNe8Q3DkazvOn9H8Fh1E7OQL/TOnxQ10MyvcujaCtQtFtvaWFyD3yMHn/FsYL
3M1/07K+DE0KcqfJxch47rb5bb3NXEocPwj0Hb+jHJluQFIIuu9PDdXhBA/KdZ+u
kltWdr/5ap//F5koUk+qECW/M3fxtQSYi6byyvUBIh9sYFGkirBj9Mha4hdb1iZp
2pR1xA5XJEj/SfvSBoHa+KaTymdKNwXnolsAmVxHKCkpxrErLu9C16HcjjH0Eue2
OYOkwcaZW405lbxoCP2CjJNQmZlBwepuhBUTrSWIlVi3YUR2MKWrUA==
=W3yD
-----END PGP SIGNATURE-----

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