Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Tk question about Ev

by smackdab (Pilgrim)
on Jun 09, 2002 at 03:49 UTC ( [id://172879]=note: print w/replies, xml ) Need Help??


in reply to Tk question about Ev

Also, Mastering Perl/Tk has a chapter (15) on MainLoop and it is talked about a little...it is a good book

Wouldn't you know, that is the chapter that O'Reilly gives for free ;-)

I think this worked out for you ;-)

Replies are listed 'Best First'.
Re: Re: Tk question about Ev
by Courage (Parson) on Jun 09, 2002 at 09:24 UTC
    Thank you a lot!
    As additional note I want to share my small improvement into Tk.pm module that makes it ~30% faster.
    (Ev is usually used in GUI event callbacks, and it's crucial to write code there which executes as fast as possible)
    sub Ev { if (@_ == 1) { my $arg = $_[0]; return bless (((ref $arg) ? $arg : \$arg), 'Tk::Ev'); } else { return bless [@_],'Tk::Ev'; } }
    I wrote small becnchmark program and can share it and its result as well.

    Courage, the Cowardly Dog.

      You should consider posting it to comp.lang.perl.tk
      There are some very good Tk people there
        I did posting to ptk mailing list, and got a reply from Slaven Rezic, he noticed that sub became faster by 20-30%.

        But then after that I did some experiments and realized that 'Ev' sub is usually used in startup and binding time, therefore it is not critical, because it is usually *not* used inside events callbacks.

        Anyway, I keep my slightly faster version of 'sub Ev' in my own VK::TkOverrides package which contain some functions to override from Tk that I think I need to fix :)

        Courage, the Cowardly Dog.
        PS. Something fishy is going on there, or my name is Vadim Konovalov. And it's not.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://172879]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (2)
As of 2024-04-20 09:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found