Consider following "stress-test" code, at first perlTk:
It does simple but numerous action: it inserts a number similar buttons into Text widget. On my slow PC it reports execution time of 52sec.use Tk; my $mw = tkinit; my $tw = $mw->Scrolled('Text')->pack; my $t0=time; for my $stresser ('a'..'zzz') { $tw->windowCreate('end',-window=>$tw->Button(-text=>$stresser)); if ($stresser =~ /z$/) { $tw->insert('end',"\n") ; $tw->see('end'); #$tw->update; } } my $t1=time; print STDERR "time=".($t1-$t0)."\n"; MainLoop;
use Tcl::Tk qw(:perlTk); my $mw = tkinit; my $tw = $mw->Scrolled('Text')->pack; my $t0=time; for my $stresser ('a'..'zzz') { $tw->windowCreate('end',-window=>$tw->Button(-text=>$stresser)); if ($stresser =~ /z$/) { $tw->insert('end',"\n") ; $tw->seeEnd; #$tw->update; } } my $t1=time; print STDERR "time=".($t1-$t0)."\n"; MainLoop;
use Tcl::Tk qw(:perlTk); my $mw = tkinit; my $tw = $mw->Scrolled('Text')->pack; my $t0=time; for my $stresser ('a'..'zzz') { $tw->_windowCreate('end',-window=>$tw->_Button(-text=>$stresser)); if ($stresser =~ /z$/) { $tw->_insert('end',"\n") ; $tw->_seeEnd; #$tw->update; } } my $t1=time; print STDERR "time=".($t1-$t0)."\n"; MainLoop;
My PerlTk installation is that one coming with ActiveState's build of both Linux and Windows perls, Tcl::Tk I built for myself...
Memory consumption is on Tcl::Tk side also better.
PS. why this stupid dog did not used Benchmark? Okay, if this is essential, I'll do deeper investigation in reply to first person who interested in that
In reply to Comparing Tcl::Tk and perlTk WRT speed by Courage
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |