in reply to Re^6: Who's a thief? (No memory growth with magic goto)
in thread Who's a thief? -- the follow up
Yes, that does appear to be (crudely measured) about twice as fast, though it wouldn't work for mutally recursive subs.
#!/usr/bin/perl -w use strict; $|++; my $count; deep( $ARGV[ 0 ] ); print $count; sub deep {SUB:{ ++$count and --$_[ 0 ] and redo SUB; }} #sub deep { # ++$count and --$_[ 0 ] and goto \&deep; #} __DATA__ [20:54:56.63] P:\test>422344 10000000 10000000 [20:54:59.48] P:\test>422344 [20:55:17.40] P:\test>422344 100000000 100000000 [20:55:41.24] P:\test>
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^8: Who's a thief? (No memory growth with magic goto)
by demerphq (Chancellor) on Jan 15, 2005 at 09:54 UTC | |
by BrowserUk (Patriarch) on Jan 15, 2005 at 15:50 UTC | |
by Aristotle (Chancellor) on Jan 18, 2005 at 07:08 UTC | |
by BrowserUk (Patriarch) on Jan 18, 2005 at 08:28 UTC | |
by Aristotle (Chancellor) on Jan 18, 2005 at 08:47 UTC | |
|