You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, not sure if this is expected or not but it seems each use of a Script object increases it's size. I've created a pool of Script objects and have a system to reuse them because construction is expensive and they shouldn't hold any state aside from the Lua I wish to run.
My use case is pretty trival:
var script = new Script();
script.DoString(ScriptOfLuaFunctions);
for(int i = 0; i <= 1000, i++) {
var table = new Table(script)
// add stuff to the table here
var result = script.Call(script.Globals["myfunction"], randomParam1, table)
}
When creating the Table or using Call, is there some extra state being added to Script somewhere? To me this use case looks like it should be stateless.
Thanks
The text was updated successfully, but these errors were encountered:
Hey, not sure if this is expected or not but it seems each use of a Script object increases it's size. I've created a pool of Script objects and have a system to reuse them because construction is expensive and they shouldn't hold any state aside from the Lua I wish to run.
My use case is pretty trival:
When creating the
Table
or usingCall
, is there some extra state being added toScript
somewhere? To me this use case looks like it should be stateless.Thanks
The text was updated successfully, but these errors were encountered: