in reply to Re^5: named sub, subref and magic goto speed
in thread named sub, subref and magic goto speed
My benchmarks show that goto $ref is quite different from goto &$ref.
First, I want to make it clear that my question has nothing to do with speed or benchmarks. My question is specifically regarding to ysth's implied assertion that goto &$ref; does not have to build a stack frame.Of course, this assumes that goto $ref; truly is the same as goto &$ref; which you yourself say:
The docs say a label is expected, but if a code ref is provided, goto $ref is treated as goto &$ref.
Since your benchmarks indicate that this isn't the case, perhaps perl is doing something special under the covers and you should revise your statement. My original question was regarding stack frames only, but at this point I am also interested in knowing why goto $ref; is behaving as if it were goto &$ref; but performs much better.
Cheers - L~R
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: named sub, subref and magic goto speed
by jdporter (Paladin) on Dec 14, 2006 at 17:15 UTC | |
by Limbic~Region (Chancellor) on Dec 14, 2006 at 17:18 UTC | |
|
Re^7: named sub, subref and magic goto speed
by Limbic~Region (Chancellor) on Dec 14, 2006 at 19:14 UTC |