Why should closures be cheaper in this situation?
Its the difference between having one function and many. The closures can all use the same compiled code internally; only a copy of the lexical environment needs to be kept. Generating accessors by eval'ing them into existence, the strategy used by Class::Struct as revealed by PodMaster, results in newly compiled code for each one.
-sauoq "My two cents aren't worth a dime.";
In reply to Re: Why do closures save memory?
by sauoq
in thread Why do closures save memory?
by bsb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |