in reply to Re^2: RFC: Practical closure example: Spreadsheet writer
in thread RFC: Practical closure example: Spreadsheet writer

Also, I would guess that using references to anonymous subs avoids most of the penalty hit of using OO (micro-optimization anyone?).

There may be a tiny benefit from avoiding potential dispatch lookup, but the benefit is fairly small. If anything, you're more likely to see memory savings (in the order of a few kilobytes). (Closures save the same CV but use different lexpads. If you reuse the closure, all references share the CV rather than constructing their own.)

  • Comment on Re^3: RFC: Practical closure example: Spreadsheet writer