|
Eventually, it could be a nice idea for the performance aspects of standard library things (s.a. table.insert) to be listed down systematically. One can, of course, do this by study of the source, but who does? :) I don't.
This could ideally be an appendix of the Lua reference manual (pdf). Just short notes and the O(n) or whatever classification would do..
-ak 15.9.2004 kello 20:30, Mark Hamburg kirjoitti:
P.S. Actually, table.insert and table.remove are not constant timeoperations since they depend on table.getn which depends to some extent on the number of tables with an n field. That, however, is a hash lookup so thecost grows very slowly.