in reply to Re: Tk question about Ev
in thread Tk question about Ev

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.

Replies are listed 'Best First'.
Re: Re: Re: Tk question about Ev
by smackdab (Pilgrim) on Jun 09, 2002 at 21:02 UTC
    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.