Thread Tk::Font::measure ist zu langsam (9 answers)
Opened by betterworld at 2005-07-24 17:03

esskar
 2005-07-25 13:35
#44247 #44247
User since
2003-08-04
7321 Artikel
ModeratorIn

user image
habs mal nochmal genau gemacht!

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use strict;
use warnings;

use Benchmark qw(:all);
use Tk;
use Tk::Font;

my $w=MainWindow->new;
my $f=$w->Font;

sub time_font_measure {
$f->measure("hallo");
}

timethis(   10, \&time_font_measure);
timethis(  100, \&time_font_measure);
timethis(  400, \&time_font_measure);
timethis( 1000, \&time_font_measure);
timethis(10000, \&time_font_measure);


timethis 10:  0 wallclock secs ( 0.00 usr +  0.00 sys =  0.00 CPU)
           (warning: too few iterations for a reliable count)
timethis 100:  0 wallclock secs ( 0.00 usr +  0.02 sys =  0.02 CPU) @ 6250.00/s (n=100)
           (warning: too few iterations for a reliable count)
timethis 400:  0 wallclock secs ( 0.05 usr +  0.02 sys =  0.06 CPU) @ 6349.21/s (n=400)
           (warning: too few iterations for a reliable count)
timethis 1000:  0 wallclock secs ( 0.13 usr +  0.05 sys =  0.17 CPU) @ 5813.95/s (n=1000)
           (warning: too few iterations for a reliable count)
timethis 10000:  2 wallclock secs ( 1.02 usr +  0.61 sys =  1.63 CPU) @ 6153.85/s (n=10000)

View full thread Tk::Font::measure ist zu langsam