lua-users home
lua-l archive

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


It was thus said that the Great Sven Olsen once stated:
> 
> Your advice is very reasonable, of course.  But, I'm afraid I have already
> started down this dark path -- and it looks like writing a data collector
> that hooks in via luaD_poscall and luaD_precall is going to suit my own
> purposes nicely ;)  (Functionally, there's really not much difference
> between this approach and the debug.sethook(hook,"cr") template code you
> posted -- but working in C++ lets me keep the instrumentation overhead a
> bit lower.)

  You can also do what I did via the Lua C API.  Then there's the advice:
make it work, make it right, make it fast, in that order.  By doing the work
in Lua, you can save time long term by finding out what exactly you want to
measure (quickly in development time) and only then drop down to a lower
level (to do it quickly at runtime).

  -spc