New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Speed of f(), $o->m(), etc. in 03,57,58,61 [Was: File::Spec::Functions in 5.005_61] #568
Comments
From The RT System itselfHere are some numbers purporting to show basic performance of function I'm presenting this before doing the File::Spec tests for two reasons: 1. It's perhaps of more general interest than the File::Spec times. 2. Peer review: I'll cook up the File::Spec ones soon, but this took Please let me know of methodology errors that might be causing off Timings of File::Spec::Unix::catdir() variants to follow if the method - Barrie ################################################################################ The data grouped by test, then compared across versions. /\d+.\d\d/ [barries@jester perls]$ ./flip data P::f(...): P->m(...): P->f(...): $o->m(...): $o->f(...): ################################################################## Here are some excerpts from the test script ('ft') that might make package P ; sub new { bless {}, shift ; } package main ; $o = P->new ; my @tests = ( for ( @tests ) { ################################################################################ Conclusions & Questions 1) Function calls (P::F(...)) sped up 15% from _03 -> _57, then settled 2) my $self = shift @_ ; slowed down enough in _58 to overcome the gains 3) Wonder why P->f(...) slowed down 4%, while $o->f(...) sped up 4% in 4) Wonder why P->m(...) and $o->m(...) didn't speed up more in _57 when 5) Wonder why P->f(...) slowed down in _58, while $o->f(...) sped up. ################################################################################ Notes1) All perls built on RH6.0 with ./Configure -des, so if Configure defaults 2) I've run the tests with a variety of COUNTs (like -5, 1_000_000, etc), 3) I put the shift in &m since it's very common in real code. 4) The three args passed are leftovers from the catdir() benchmarks. I left 5) I did not disable CPU caches or run in single user mode. The numbers ################################################################################ The output of the test tool run on each perl in the series: [barries@jester perls]$ cat data ################################################################################ The harness [barries@jester perls]$ cat t rm -f data for PERL in `ls -d perl*_??` ################################################################################ The test tool [barries@jester perls]$ cat ft use strict ; package P ; sub new { bless {}, shift ; } ########################################### package main ; use Benchmark qw( timethis enablecache ) ; use vars '$o' ; $o = P->new ; my @tests = ( $| = 1 ; my $count = $ARGV[0] || 1_000_000 ; my $count_desc = $count > 0 ? "$count iterations" : -$count . " seconds" ; print( "perl v$], $count_desc per test\n" ) ; my $width = 6 ; enablecache ; for ( @tests ) { # use Data::Dumper qw( Dumper ) ; print Dumper( \@tests ) ; printf( " %${width}s %-6s ", '', 'Rate' ) ; for ( @tests ) { print( "\n" ) ; for ( my $line = 0 ; $line < @tests ; ++$line ) { sub print_pct { |
@iabyn - Status changed from 'stalled' to 'resolved' |
Migrated from rt.perl.org#1420 (status was 'resolved')
Searchable as RT1420$
The text was updated successfully, but these errors were encountered: