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
The current mlua thread API seems to push the values into the main Lua stack first before using xmove to move the pushed values from main stack to the thread state.
Would it not be more efficient to modify IntoLua trait to accept another parameter of lua_State to directly copy the values to thread state directly which would vastly reduce the number of stack operations performed by mlua?
The text was updated successfully, but these errors were encountered:
cheesycod
changed the title
Are the thread API's inefficient?
Are the thread API's highly inefficient?
Jan 21, 2025
cheesycod
changed the title
Are the thread API's highly inefficient?
Are the thread API's more inefficient than they need to be?
Jan 21, 2025
Unless you're passing a significant number of arguments to the threads unlikely you will notice any difference. It's relatively lightweight operation and takes only fraction of time compared to running the entire thread to completion.
Would it not be more efficient to modify IntoLua trait to accept another parameter of lua_State to directly copy the values to thread state directly
Generally I agree that it would be more efficient. But it's a relatively large code change for a small use case with few edge cases that should be taken care of. Would be good to get confidence of performance boost before making any changes.
The current mlua thread API seems to push the values into the main Lua stack first before using
xmove
to move the pushed values from main stack to the thread state.Would it not be more efficient to modify IntoLua trait to accept another parameter of
lua_State
to directly copy the values to thread state directly which would vastly reduce the number of stack operations performed by mlua?The text was updated successfully, but these errors were encountered: