Tencent / xLua

xLua is a lua programming solution for C# ( Unity, .Net, Mono) , it supports android, ios, windows, linux, osx, etc.
Other
9.33k stars 2.45k forks source link

Nullable GC问题 #771

Open bluedoom opened 4 years ago

bluedoom commented 4 years ago

可空值类型Checker和Caster没有加缓存,每次调用都会有GCAlloc image https://github.com/Tencent/xLua/blob/04e38ac207f220c9d7357a287f2a88c60e0fd107/Assets/XLua/Src/ObjectCasters.cs#L201 https://github.com/Tencent/xLua/blob/04e38ac207f220c9d7357a287f2a88c60e0fd107/Assets/XLua/Src/ObjectCasters.cs#L722

chexiongsheng commented 4 years ago

想真正性能好不是应该生成wrap代码么?

bluedoom commented 4 years ago

想真正性能好不是应该生成wrap代码么?

有使用生成代码,但是可空值类型导致生成代码执行又绕回了GetObject。 image image