lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Wed, Dec 19, 2012 at 6:40 PM, Philipp Janda <siffiejoe@gmx.net> wrote:
> True, but lesser so if you write library code, because you might never run
> the final program to observe the performance hotspot. And it's not that you
> have to work hard to avoid those temporaries -- you just have to do the
> obvious thing ...

When I am in 'library writer' mode, I think like that.  This is why I
was curious about select() performance, since {...} can generate a
_lot_ of garbage.  And we cannot assume that the caller can handle
that cheerfully (maybe they're short on RAM and GC costs too much)

In short, libraries are not places for clever stuff; they are places
for well-named pieces of straightforward code, that's sometimes a
little less obvious because of performance (e.g. use numerical for
instead of for/ipairs)

steve d.

PS although everything falls apart with  'well-named'