Since finding good "real world" benchmarks for Perl is hard, I think it might be worth discussing more generally situations where we write less elegant and readable code for the sake of performance. Why do I say this? Because "faster please" and "prettier please" seem to be the two main camps that people fall into when feature/syntax debates pop up lately. Optimizations that allow ugly code to be prettier and run just as fast (or faster) should be the sort of thing that both camps can support. (The third camp is probably the "backward compatible" camp. And, no, those aren't mutually exclusive, but I think everyone has their own prioritization of "fast", "pretty" and "compatible" and most debates are people talking past each other simply because they have different priorities.) So... what are the things that you do that make code *uglier* or *harder* to maintain for the sake of speed? Off the top of my head: * Duplicating code instead of refactoring to small subs to avoid function/method call overhead. * Accessing object attribute directly instead of using accessor calls * Saving a long dereference chain into a temporary lexical prior to looping to avoid repeated dereferencing * Accessing elements of @_ directly instead of copying to lexicals * Passing references to scalars as subroutine arguments to avoid copying a large scalar What else have you done? Once we have a good list, maybe we can benchmark the impact of *those* to get a sense for the opportunity and assess proposals that address them. -- David Golden <xdg@xdg.me> Take back your inbox! → http://www.bunchmail.com/ Twitter/IRC: @xdgThread Next