in reply to Re^2: Label makes a sub to return empty list -- "secret"? documented?
in thread Label makes a sub to return empty list -- "secret"? documented?

Sometimes, I prefer to invert the numbers to get the time saved to put things into perspective.

27367269 calls/s = 37 ns/call 31367629 calls/s = 32 ns/call 35161744 calls/s = 28 ns/call

So _: is 9 ns faster than return (assuming the numbers are meaningful).

After 100 million calls, you still wouldn't have saved a second by switching from return to _:.

Update: I had moved a decimal point in the wrong direction. Fixed.

Replies are listed 'Best First'.
Re^4: Label makes a sub to return empty list -- "secret"? documented?
by hippo (Archbishop) on Sep 13, 2025 at 09:26 UTC
    27367269 calls/s = 0.365 ns/call

    I think your numbers are a couple of orders of magnitude out. By my maths 1 / 27367269 = 0.0000000365, so that's 36.5ns per call.

    Even so, your point is valid. It is only in extreme cases where any of this is really worth worrying about.


    🦛

      The numbers seemed absurd, but I was too tired to register I needed to redo the math. I had moved a decimal point in the wrong direction. Fixed.