lua-users home
lua-l archive

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

Thanks everyone for your suggestions!

I understand the concept of using userdata environment table. Yet I have some concerns about it:
- I doubt that exploring the userdata environment through the C api provides sufficient gains -- scripted lua is probably doing a much better job
- Keeping pointers on userdata + references on userdata through userdata env will help improving perfs at the cost of doubling memory consumption -- well I can afford some more bytes

I have experienced a bit with Peter's tweak, and it seems to work. I'll run a monkey for a day or two and would anything go awry, I'll switch to keeping refs both in userdata and environment.
For what it's worth, the patch is pretty straight forward and contains a few dozens lines -- thanks to the lua code being incredibly small!