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
{{ message }}
Repository navigation
Commit 94de422
Browse filesBrowse the repository at this point in the historyBrowse files
> `__index` and `__newindex` cannot be set as they are used internally by the code generated by `[LuaObject]`.
539
539
540
+
Generated default metatables are immutable and shared by all instances of the same C# type, across Lua states. You can still assign writable C# members from Lua. To customize an individual object's metatable, replace `ILuaUserData.Metatable` in C# or use `debug.setmetatable` in Lua; replacement tables remain mutable. Ordinary Lua tables and metatables remain mutable.
541
+
540
542
## Module Loading
541
543
542
544
In Lua, you can load modules using the `require` function. In regular Lua, modules are managed by searchers within the `package.searchers` function list. In addition to this, Lua-CSharp provides `ILuaModuleLoader` as a module loading mechanism.
?"local run=coroutine.wrap(function() for i=1,64 do coroutine.yield(packet()) end end); for i=1,64 do run() end; run(); return 42"
38
+
:"local co=coroutine.create(function() for i=1,64 do coroutine.yield(packet()) end end); for i=1,64 do coroutine.resume(co) end; coroutine.resume(co); return 42",
39
+
"coroutine-transfer"
40
+
);
41
+
if(Run()!=42)
42
+
thrownewInvalidOperationException("Unexpected coroutine transfer result");
|`InterpreterComparison`| Execute a retained compiled chunk and read one numeric result | Numeric loops, Lua calls/varargs, table access/sort, metamethods, math, strings, patterns, coroutines, host callbacks, n-body |
26
26
|`CompilationComparison`| Compile source in an existing state; no execution | Small loop, n-body, control flow, identifiers, plain strings, escaped strings |
27
27
|`StartupComparison`| Create a state, open libraries, dispose where supported | One lifecycle per engine |
28
+
|`GeneratedUserDataBenchmark`| Execute 1,000 generated C# member accesses or comparisons; report time per operation | Property reads/writes, method calls, comparisons, with default and explicitly replaced metatables |
29
+
|`CoroutineTransferBenchmark`| Transfer 64 yielded packets; report time per transfer |`resume` and `wrap`, 1–4,096 results per packet, with and without cancellation |
28
30
29
31
Only the engine being measured is initialized for a benchmark. Execution
30
32
excludes source compilation and state setup. Scripts rebuild their mutable
0 commit comments