ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl5-porters
perl5-porters
[Fwd: Avoiding redefining sub warnings in Benchmark.pm]
by Jarkko Hietaniemi other posts by this author
May 22 2007 5:46PM messages near this date
Re: [PATCH] Forgotten Cygwin patch | [perl #43023] Failure in perl 5.8.5 installation in linux7.2 - Please help
-------- Original Message --------
Subject: Avoiding redefining sub warnings in Benchmark.pm
Date: Tue, 22 May 2007 20:18:50 -0400
From: Steven Lembark <lembark@[...].com> 
Reply-To: lembark@[...].com
Organization: Workhorse Computing
To: Jarkko Hietaniemi <jhi@[...].fi> , Tim Bunce <Tim.Bunce@[...].uk>


Given that Time::Hires uses a prototype (ouch), the
goto isn't enough overhead on the systems I've tested
this with to cause any real difference (i.e., after
100_000 iterations Benchmark didn't show any difference
testing a runt sub):


  my $time = sub { time };

  sub mytime () { goto &$time }

  ...

  sub import
  {
      my $class = shift;
      if (grep { $_ eq ":hireswallclock" } @_)
      {
        ...

        $time = $hirestime if defined $hirestime;
      }

      Benchmark-> export_to_level(1, $class, @_);
  }


enjoi

-- 
Steven Lembark                                         85-09 90th Street
Workhorse Computing                                  Woodhaven, NY 11421
lembark@[...].com                                      +1 888 359 3508
	

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved