Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optimization for calls to LuaClass methods within Lua #4

Open
TheModMaker opened this issue Mar 5, 2016 · 0 comments
Open

Add optimization for calls to LuaClass methods within Lua #4

TheModMaker opened this issue Mar 5, 2016 · 0 comments

Comments

@TheModMaker
Copy link
Owner

If a method defined on a class is called from within Lua, it is boxed, converted, then converted back and unboxed. It would be better to detect that the method is defined in Lua and call it directly to avoid the extra boxing and conversions.

Example:

interface ITest {
  int Do();
}
class Test : ITest

function Test::Do()
  return 12
end

local obj = Test()
local x = obj:Do()

In this example, the call to Do will first return the 12 as a double in a multi-value. Then it is converted to an integer in a wrapper function for the C# interface. Then it is boxed and converted back to a double to store in the variable x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant