Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.98k stars 559 forks source link

Benchmark und bigint don't work together #6966

Closed p5pRT closed 14 years ago

p5pRT commented 20 years ago

Migrated from rt.perl.org#24622 (status was 'resolved')

Searchable as RT24622$

p5pRT commented 20 years ago

From perl_dummy@bloodgate.com

-----BEGIN PGP SIGNED MESSAGE-----

Moin\,

using BigInt v1.67 or BigInt v1.66 does not matter​:

# perl -MBenchmark -Mbigint -le '$a = 123 ** 123; timethese ( -3\, { "blog" => sub { $a->copy()->blog(123) }\, } )' Benchmark​: running blog for at least 3 CPU seconds ...

runloop unable to compile 'CODE(0x81d0c48)'​: Bareword "NaN" not allowed while "strict subs" in use at (eval 31) line 1.

code​: sub { for (1 .. NaN) { local $_; package main; &$c; } } at -e line 1

Oops. Whats that?

Best wishes\,

Tels

- -- Signed on Sun Dec 7 23​:12​:26 2003 with key 0x93B84C15. Visit my photo gallery at http​://bloodgate.com/photos/ PGP key on http​://bloodgate.com/tels.asc or per email.

"Die deutsche Zensoren - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Dummköpfe - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -." Heinrich Heine

-----BEGIN PGP SIGNATURE----- Version​: GnuPG v1.2.2-rc1-SuSE (GNU/Linux) Comment​: When cryptography is outlawed\, bayl bhgynjf jvyy unir cevinpl.

iQEVAwUBP9OmjncLPEOTuEwVAQG5sQf+Mu+GfDE8DDWCMjPFucHBvdE+fccKXOWO T5djoNUUHBJVo1BpvdqTrIQw2fT+wFxZMPurxucrHKoj1IACAMXXbvMMCh4ay4DG 4yk2nfO5BcundjkjZk7dNHeoujCppnlSnkSzQKUh3yFGKEzPm4MbRt7gHGP7eDBe G7yHE85TYfep/ehL4y6Y3esA50QG7Tr30t/diWOFcwWsPPDx9uFD4Ae9KToBQdWA F5NNWjiKb7A/ZoCysik1yiUAAE6Xt3Y+oJ2LTHaq/eU38yhZ+t0oGDxddEKtc9qy blt7OVm3EDECIkJzM8IGttcLE5o9HmHTcFXMbstCk2hrgTEbiVjHkQ== =4TZ2 -----END PGP SIGNATURE-----

Perl Info ``` Flags: category=library severity=low Site configuration information for perl v5.8.1: Configured by te at Sat Sep 27 20:54:50 CEST 2003. Summary of my perl5 (revision 5.0 version 8 subversion 1) configuration: Platform: osname=linux, osvers=2.4.20-4gb-athlon, archname=i686-linux uname='linux null 2.4.20-4gb-athlon #1 wed aug 6 18:27:52 utc 2003 i686 unknown unknown gnulinux ' config_args='-ds -e' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O3', cppflags='-fno-strict-aliasing -I/usr/local/include' ccversion='', gccversion='3.3 20030226 (prerelease) (SuSE Linux)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -ldl -lm -lcrypt -lutil -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc libc=, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.3.2' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic' cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib' Locally applied patches: @INC for perl v5.8.1: /usr/local/lib/perl5/5.8.1/i686-linux /usr/local/lib/perl5/5.8.1 /usr/local/lib/perl5/site_perl/5.8.1/i686-linux /usr/local/lib/perl5/site_perl/5.8.1 /usr/local/lib/perl5/site_perl . Environment for perl v5.8.1: HOME=/home/te LANG=en_US LANGUAGE (unset) LC_COLLATE=POSIX LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/ bin:/opt/kde3/bin:/usr/lib/java/bin:/opt/gnome/bin PERL_BADLANG (unset) SHELL=/bin/bash ```
p5pRT commented 20 years ago

From @hvds

Tels (via RT) \perlbug\-followup@​perl\.org wrote​: :using BigInt v1.67 or BigInt v1.66 does not matter​: : :# perl -MBenchmark -Mbigint -le '$a = 123 ** 123; timethese ( -3\, { "blog" => :sub { $a->copy()->blog(123) }\, } )' :Benchmark​: :running : blog : for at least 3 CPU seconds :... : :runloop unable to compile 'CODE(0x81d0c48)'​: Bareword "NaN" not allowed while :"strict subs" in use at (eval 31) line 1. : :code​: sub { for (1 .. NaN) { local $_; package main; &$c; } } : at -e line 1 : :Oops. Whats that?

I suspect -Mbigint is not compatible with the use of floating point within Benchmark; at line 750​:   $n = int( $n * ( 1.05 * $tmax / $tc ) ); $tc is 0.1\, but I believe it is getting upgraded to a Bigint 0\, resulting in a division by zero that leaves $n = \inf\, and that is then being interpolated into the '1 .. $n' range in the eval code.

Hugo

p5pRT commented 20 years ago

From perl_dummy@bloodgate.com

-----BEGIN PGP SIGNED MESSAGE-----

Moin\,

On Tuesday 09 December 2003 12​:41\, Hugo van der Sanden via RT wrote​:

Tels (via RT) \perlbug\-followup@​perl\.org wrote​: :using BigInt v1.67 or BigInt v1.66 does not matter​: : :# perl -MBenchmark -Mbigint -le '$a = 123 ** 123; timethese ( -3\, { "blog" : => sub { $a->copy()->blog(123) }\, } )' :Benchmark​: :running : blog : for at least 3 CPU seconds :... : :runloop unable to compile 'CODE(0x81d0c48)'​: Bareword "NaN" not allowed : while "strict subs" in use at (eval 31) line 1. : :code​: sub { for (1 .. NaN) { local $_; package main; &$c; } } : at -e line 1 :Oops. Whats that?

I suspect -Mbigint is not compatible with the use of floating point within Benchmark; at line 750​: $n = int( $n * ( 1.05 * $tmax / $tc ) ); $tc is 0.1\, but I believe it is getting upgraded to a Bigint 0\, resulting in a division by zero that leaves $n = \inf\, and that is then being interpolated into the '1 .. $n' range in the eval code.

The attached patch fixes the problem by converting the input via "$tmax" to a scalar (if it is an Big* object). It also removes the else { } path by clever usage of abs().

I also rewrote the part that prints out little pieces of string (and removed all these nasty "unless $style eq 'none'" bits which made that code hard to read (for me))\, because under -le this results in something like this​:

~/perl/benchmark-bigint> perl -I. -MBenchmark -Mbigint -le '$a = 123 ** 123; timethese ( -3\, { "blog" => sub { $a->copy()->blog(123) }\, } )' Benchmark​: running blog for at least 3 CPU seconds ...

  blog​: 3 wallclock secs ( 3.21 usr + 0.00 sys = 3.21 CPU) @​ 543.93/s (n=1746)

After the patch you get​:

~/perl/benchmark-bigint> perl -I. -MBenchmark -Mbigint -le '$a = 123 ** 123; timethese ( -3\, { "blog" => sub { $a->copy()->blog(123) }\, } )' Benchmark​: running blog for at least 3 CPU seconds...

  blog​: 3 wallclock secs ( 3.20 usr + 0.00 sys = 3.20 CPU) @​ 549.38/s (n=1758)

Which is more pleasing to my eye.

I didn't know exactly how to add Benchmark tests reliable\, can somebody point me what to look out for?

RFC​: Would it possible to replace the default output of "X wallclock secs" with "Xs"? The overly long output itches me\, but the change might be shot down by the backward-compatible policy....

Best wishes\,

Tels

- -- Signed on Fri Dec 12 19​:30​:09 2003 with key 0x93B84C15. Visit my photo gallery at http​://bloodgate.com/photos/ PGP key on http​://bloodgate.com/tels.asc or per email.

"Für eine solche Bitratenreduktion muss ich den Transcoder so umkonfigurieren\, dass er gröbere Quantisierungskoeffizienten für die MPEG-Matrizen verwendet\, Captain" - "An die Arbeit\, Mr. LaForge." -- Jens Baumeister in http​://tinyurl.com/oomb

-----BEGIN PGP SIGNATURE----- Version​: GnuPG v1.2.2-rc1-SuSE (GNU/Linux) Comment​: When cryptography is outlawed\, bayl bhgynjf jvyy unir cevinpl.

iQEVAwUBP9oJNHcLPEOTuEwVAQFnUwf+OPe4HPFfj6Wtsn0HfCp6FCuLcgGC1Hmr ElQ34bKUBvkw03Z1FqxomZsqQIJc22jgpmYihkIzAvndkDOsm1mpFjbzWJmUsfyQ 5m2ARbZCE9EqAnFu0qeAtpZhFnhgkyLm1m6hHV0W586s1pon76vRm7PsSTZxuK0r rSFpPa4hx+Rkd5LmdB+NXXL62l2Zi0bIdOQZav4/bvHV2viyp9P4Y5KWcPd8FFAd ZLZn9Idw0nSeAtzXg83H7WH63rFaXcUltgns6OBaZM+I8V+ErnN92yNhKWpvqIri 8aq3rNqFla4Td2A4ilpjQbjoDCZ2HYNmho1eyErOEXbhynwNcrqITA== =RSl6 -----END PGP SIGNATURE-----

p5pRT commented 20 years ago

From perl_dummy@bloodgate.com

Inline Patch ```diff diff -ruN blead/lib/Benchmark.pm blead.benchmark.patch/lib/Benchmark.pm --- blead/lib/Benchmark.pm 2003-11-05 22:57:04.000000000 +0100 +++ blead.benchmark.patch/lib/Benchmark.pm 2003-12-12 19:26:15.000000000 +0100 @@ -702,9 +702,9 @@ if ( not defined $tmax or $tmax == 0 ) { $tmax = $default_for; - } elsif ( $tmax < 0 ) { - $tmax = -$tmax; - } + }; + # convert possible BigInt to scalar and -$tmax to $tmax + $tmax = abs("$tmax"); die "countit($tmax, ...): timelimit cannot be less than $min_for.\n" if $tmax < $min_for; @@ -827,20 +827,21 @@ my @names = sort keys %$alt; $style = "" unless defined $style; - print "Benchmark: " unless $style eq 'none'; + + my $output = "Benchmark: "; if ( $n > 0 ) { croak "non-integer loopcount $n, stopped" if int($n)<$n; - print "timing $n iterations of" unless $style eq 'none'; + $output .= "timing $n iterations of"; } else { - print "running" unless $style eq 'none'; + $output .= "running"; } - print " ", join(', ',@names) unless $style eq 'none'; + $output .= " " . join(', ',@names); unless ( $n > 0 ) { my $for = n_to_for( $n ); - print ", each" if $n > 1 && $style ne 'none'; - print " for at least $for CPU seconds" unless $style eq 'none'; + $output .= ", each" if $n > 1; + $output .= " for at least $for CPU seconds"; } - print "...\n" unless $style eq 'none'; + print "$output...\n" unless $style eq 'none'; # we could save the results in an array and produce a summary here # sum, min, max, avg etc etc ```
p5pRT commented 20 years ago

From @hvds

Tels \perl\_dummy@&#8203;bloodgate\.com wrote​: :On Tuesday 09 December 2003 12​:41\, Hugo van der Sanden via RT wrote​: :> I suspect -Mbigint is not compatible with the use of floating point within :> Benchmark : :The attached patch fixes the problem by converting the input via "$tmax" to a :scalar (if it is an Big* object). It also removes the else { } path by clever :usage of abs().

I am very dubious about modifying something like Benchmark to cope with -Mbigint's way of modifying what perl does - it is perfectly reasonable for any normal module to assume it can assign a floating-point value to a number without it being converted to an integer.

A more supportable direction to progress would perhaps be to introduce a way to restrict the effect of 'use bigint' to a lexical scope. I feel that would make bigint more useful in general\, and make it much easier to combine with external libraries without having to rewrite each one to get cleverer (and less perlish) about its use of floating point.

The other changes might well be desirable​: I've found the output of timethese() much less readable since previous patches extended the output beyond 80 characeters\, and I think it should be sufficient to explain the output in the documentation without having to spell out 'wallclock seconds' every time.

Hugo

p5pRT commented 20 years ago

From perl_dummy@bloodgate.com

-----BEGIN PGP SIGNED MESSAGE-----

Moin\,

On Saturday 13 December 2003 12​:59\, hv@​crypt.org wrote​:

Tels \perl\_dummy@&#8203;bloodgate\.com wrote​: :On Tuesday 09 December 2003 12​:41\, Hugo van der Sanden via RT wrote​: :> I suspect -Mbigint is not compatible with the use of floating point :> within Benchmark : :The attached patch fixes the problem by converting the input via "$tmax" : to a scalar (if it is an Big* object). It also removes the else { } path : by clever usage of abs().

I am very dubious about modifying something like Benchmark to cope with -Mbigint's way of modifying what perl does - it is perfectly reasonable for any normal module to assume it can assign a floating-point value to a number without it being converted to an integer.

A more supportable direction to progress would perhaps be to introduce a way to restrict the effect of 'use bigint' to a lexical scope. I feel that would make bigint more useful in general\, and make it much easier to combine with external libraries without having to rewrite each one to get cleverer (and less perlish) about its use of floating point.

You are very probably right. The patch was an easy solution. use bigint; should work like use integer; - however\, I have currently no time/energy to rewrite it. I can put it on my TODO\, but it might be there forever....

However\, one more comment​:

te@​null​:\~> perl -I. -MBenchmark -MMath​::BigInt -le '$a = Math​::BigInt->new(123) ** 123; timethese ( Math​::BigInt->new(-3)\, { "blog" => sub { $a->copy()->blog(123); }\, } )' Benchmark​: running blog for at least 3 CPU seconds...

runloop unable to compile 'CODE(0x81d0548)'​: Bareword "NaN" not allowed while "strict subs" in use at (eval 18) line 1.

code​: sub { for (1 .. NaN) { local $_; package main; &$c; } } at -e line 1

I think because Benchmark and BigInt are both core modules\, and benchmark is widely used\, it should also cope with BigInt inputs to it's subroutines. Especially when the change is so small and simple. However\, I can see your point in not special casing it.

The other changes might well be desirable​: I've found the output of timethese() much less readable since previous patches extended the output beyond 80 characeters\, and I think it should be sufficient to explain the output in the documentation without having to spell out 'wallclock seconds' every time.

\Me too\.

One more point that really annoys me​: The default output is to two digits after the dot (1.23\, 1234.56\, 123456.78). This doesn't really make sense\, because it implies an accuracy that really cannot be achieved (12345.67 implies the result is accurate to 7 digits). Something like "12340" would be probably better (e.g. max 4 digits accuracy). Of course\, output like "0.28" would stay "0.28". That would also shorten the output a bit.

Attached is a patch to​:

* make perl -MBenchmark -le more pleasing as by my first patch * replace the "wallclock secs" by "s" * adjusts the expected test output

All tests successful. u=2.36 s=0.45 cu=135.09 cs=13.7 scripts=789 tests=78632

Cheers\,

Tels

- -- Signed on Sat Dec 13 13​:02​:17 2003 with key 0x93B84C15. Visit my photo gallery at http​://bloodgate.com/photos/ PGP key on http​://bloodgate.com/tels.asc or per email.

"We have problems like this all of the time\," Kirk said\, trying to reassure me. "Sometimes its really hard to get things burning." -- http​://tinyurl.com/qmg5

-----BEGIN PGP SIGNATURE----- Version​: GnuPG v1.2.2-rc1-SuSE (GNU/Linux) Comment​: When cryptography is outlawed\, bayl bhgynjf jvyy unir cevinpl.

iQEVAwUBP9sIo3cLPEOTuEwVAQE9pAf/QthAM2LoFMLOjhzTDZ9yO5hQWWDGab8Y oR5gaXEWhfHCVypH3pM2cJXwUfJ0AqWH2zsHF90RjE+PVheFcltNnJEDi+FKlA6v 1Wrc+74CEfM5uyGEcn88fy5VsfGMHw+h+BRNNGoplfX0C42gsXU5qanLmKfCDJB8 q7/dU+ORJ2W5r8O8XG05lneBM2FcqA9XXdn/Uv05BfN9aGdI7VdUjWvxmbQFkjXq R+Bb/FnCBzJLHw5ry1z4Vhm8fpThJqtHg+O5DxRKZhY3t7GzMUbSx12EO80Q4Caj bAWePrLW/172tnfSr6v+8oLpF806JAKdMhqyar5qCkt6rUSQidqRyA== =v0+N -----END PGP SIGNATURE-----

p5pRT commented 20 years ago

From perl_dummy@bloodgate.com

Inline Patch ```diff diff -ruN blead/lib/Benchmark.pm blead.benchmark.patch/lib/Benchmark.pm --- blead/lib/Benchmark.pm 2003-11-05 22:57:04.000000000 +0100 +++ blead.benchmark.patch/lib/Benchmark.pm 2003-12-13 13:21:06.000000000 +0100 @@ -350,8 +350,8 @@ outputs something like this: Benchmark: running a, b, each for at least 5 CPU seconds... - a: 10 wallclock secs ( 5.14 usr + 0.13 sys = 5.27 CPU) @ 3835055.60/s (n=20210743) - b: 5 wallclock secs ( 5.41 usr + 0.00 sys = 5.41 CPU) @ 1574944.92/s (n=8520452) + a: 10 s ( 5.14 usr + 0.13 sys = 5.27 CPU) @ 3835055.60/s (n=20210743) + b: 5 s ( 5.41 usr + 0.00 sys = 5.41 CPU) @ 1574944.92/s (n=8520452) Rate b a b 1574945/s -- -59% a 3835056/s 144% -- @@ -588,11 +588,11 @@ $style = ($ct>0) ? 'all' : 'noc' if $style eq 'auto'; my $s = "@t $style"; # default for unknown style my $w = $hirestime ? "%2g" : "%2d"; - $s=sprintf("$w wallclock secs (%$f usr %$f sys + %$f cusr %$f csys = %$f CPU)", + $s=sprintf("$w s (%$f usr %$f sys + %$f cusr %$f csys = %$f CPU)", $r,$pu,$ps,$cu,$cs,$tt) if $style eq 'all'; - $s=sprintf("$w wallclock secs (%$f usr + %$f sys = %$f CPU)", + $s=sprintf("$w s (%$f usr + %$f sys = %$f CPU)", $r,$pu,$ps,$pt) if $style eq 'noc'; - $s=sprintf("$w wallclock secs (%$f cusr + %$f csys = %$f CPU)", + $s=sprintf("$w s (%$f cusr + %$f csys = %$f CPU)", $r,$cu,$cs,$ct) if $style eq 'nop'; $s .= sprintf(" @ %$f/s (n=$n)", $n / ( $pu + $ps )) if $n && $pu+$ps; $s; @@ -827,20 +827,21 @@ my @names = sort keys %$alt; $style = "" unless defined $style; - print "Benchmark: " unless $style eq 'none'; + + my $output = "Benchmark: "; if ( $n > 0 ) { croak "non-integer loopcount $n, stopped" if int($n)<$n; - print "timing $n iterations of" unless $style eq 'none'; + $output .= "timing $n iterations of"; } else { - print "running" unless $style eq 'none'; + $output .= "running"; } - print " ", join(', ',@names) unless $style eq 'none'; + $output .= " " . join(', ',@names); unless ( $n > 0 ) { my $for = n_to_for( $n ); - print ", each" if $n > 1 && $style ne 'none'; - print " for at least $for CPU seconds" unless $style eq 'none'; + $output .= ", each" if $n > 1; + $output .= " for at least $for CPU seconds"; } - print "...\n" unless $style eq 'none'; + print "$output...\n" unless $style eq 'none'; # we could save the results in an array and produce a summary here # sum, min, max, avg etc etc diff -ruN blead/lib/Benchmark.t blead.benchmark.patch/lib/Benchmark.t --- blead/lib/Benchmark.t 2003-08-07 21:33:32.000000000 +0200 +++ blead.benchmark.patch/lib/Benchmark.t 2003-12-13 13:19:57.000000000 +0100 @@ -23,11 +23,11 @@ $ballast = 15; my $All_Pattern = - qr/(\d+) +wallclock secs? +\( *(-?\d+\.\d\d) +usr +(-?\d+\.\d\d) +sys +\+ +(-?\d+\.\d\d) +cusr +(-?\d+\.\d\d) +csys += +(-?\d+\.\d\d) +CPU\)/; + qr/(\d+) +s? +\( *(-?\d+\.\d\d) +usr +(-?\d+\.\d\d) +sys +\+ +(-?\d+\.\d\d) +cusr +(-?\d+\.\d\d) +csys += +(-?\d+\.\d\d) +CPU\)/; my $Noc_Pattern = - qr/(\d+) +wallclock secs? +\( *(-?\d+\.\d\d) +usr +\+ +(-?\d+\.\d\d) +sys += +(-?\d+\.\d\d) +CPU\)/; + qr/(\d+) +s? +\( *(-?\d+\.\d\d) +usr +\+ +(-?\d+\.\d\d) +sys += +(-?\d+\.\d\d) +CPU\)/; my $Nop_Pattern = - qr/(\d+) +wallclock secs? +\( *(-?\d+\.\d\d) +cusr +\+ +(-?\d+\.\d\d) +csys += +\d+\.\d\d +CPU\)/; + qr/(\d+) +s? +\( *(-?\d+\.\d\d) +cusr +\+ +(-?\d+\.\d\d) +csys += +\d+\.\d\d +CPU\)/; # Please don't trust the matching parenthises to be useful in this :-) my $Default_Pattern = qr/$All_Pattern|$Noc_Pattern/; @@ -110,10 +110,10 @@ is (timestr ($diff, 'none'), '', "none supresses output"); my $noc = timestr ($diff, 'noc'); - like ($noc, qr/$wallclock +wallclock secs? +\( *$usr +usr +\+ +$sys +sys += +$cpu +CPU\)/, 'timestr ($diff, "noc")'); + like ($noc, qr/$wallclock +s? +\( *$usr +usr +\+ +$sys +sys += +$cpu +CPU\)/, 'timestr ($diff, "noc")'); my $nop = timestr ($diff, 'nop'); - like ($nop, qr/$wallclock +wallclock secs? +\( *$cusr +cusr +\+ +$csys +csys += +\d+\.\d\d +CPU\)/, 'timestr ($diff, "nop")'); + like ($nop, qr/$wallclock +s? +\( *$cusr +cusr +\+ +$csys +csys += +\d+\.\d\d +CPU\)/, 'timestr ($diff, "nop")'); if ($auto eq $noc) { pass ('"auto" is "noc"'); @@ -122,7 +122,7 @@ } like (timestr ($diff, 'all', 'E'), - qr/(\d+) +wallclock secs? +\( *\d\.\d+E[-+]?\d\d\d? +usr +\d\.\d+E[-+]?\d\d\d? +sys +\+ +\d\.\d+E[-+]?\d\d\d? +cusr +\d\.\d+E[-+]?\d\d\d? +csys += +\d\.\d+E[-+]?\d\d\d? +CPU\)/, 'timestr ($diff, "all", "E") [sprintf format of "E"]'); + qr/(\d+) +s? +\( *\d\.\d+E[-+]?\d\d\d? +usr +\d\.\d+E[-+]?\d\d\d? +sys +\+ +\d\.\d+E[-+]?\d\d\d? +cusr +\d\.\d+E[-+]?\d\d\d? +csys += +\d\.\d+E[-+]?\d\d\d? +CPU\)/, 'timestr ($diff, "all", "E") [sprintf format of "E"]'); } my $out = tie *OUT, 'TieOut'; ```
p5pRT commented 20 years ago

From @rgs

Tels wrote​:

A more supportable direction to progress would perhaps be to introduce a way to restrict the effect of 'use bigint' to a lexical scope. I feel that would make bigint more useful in general\, and make it much easier to combine with external libraries without having to rewrite each one to get cleverer (and less perlish) about its use of floating point.

You are very probably right. The patch was an easy solution. use bigint; should work like use integer; - however\, I have currently no time/energy to rewrite it. I can put it on my TODO\, but it might be there forever....

I expect that when lexical pragmas will be fixed\, we'll make a pass on all pragmas\, and that you may receive a patch :)

p5pRT commented 14 years ago

From @cpansprout

I’m marking this as resolved\, as bigint is lexical now.

p5pRT commented 14 years ago

@cpansprout - Status changed from 'open' to 'resolved'