To me, at least, this is seriously cool. I'm surprised this isn't more widely known or used.
Update: If you're wondering what prompted this, check out Sepia version 0.90 shortly. It only takes a couple hundred lines of ELisp + Perl to get a pretty decent GUD debugger in Emacs, and a minimal one would probably be less than 100. Once again, thank you Free Software!
Here are the benchmarks, with typical runtimes on my system:
sub fib { my $n = shift; if ($n < 2) { return $n; } else { return fib($n-1) + fib($n-2); } } __END__ $ time perl -le 'BEGIN { sub DB::DB {}; $^P=0x303 }; do "/tmp/fib.pl"; + print fib(28)' 317811 real 0m0.949s user 0m0.941s sys 0m0.006s $ time perl -le 'do "/tmp/fib.pl"; print fib(28)' 317811 real 0m0.924s user 0m0.918s sys 0m0.005s $ time perl -le 'BEGIN { sub DB::DB {}; $^P=0xfff }; do "/tmp/fib.pl"; + print fib(28)' 317811 real 0m1.719s user 0m1.712s sys 0m0.006s $ time perl -le 'BEGIN { sub DB::DB {}; $^P=0x303; $DB::trace=1 }; do +"/tmp/fib.pl"; print fib(28)' 317811 real 0m1.557s user 0m1.548s sys 0m0.006s
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: perl -d: faster and less scary than you think
by liverpole (Monsignor) on Jun 04, 2007 at 03:03 UTC | |
by doom (Deacon) on Jun 04, 2007 at 19:01 UTC | |
Re: perl -d: faster and less scary than you think
by doom (Deacon) on Jun 04, 2007 at 02:43 UTC | |
by educated_foo (Vicar) on Jun 04, 2007 at 03:04 UTC | |
Re: perl -d: faster and less scary than you think
by kwaping (Priest) on Jun 04, 2007 at 17:20 UTC |