As of RagePluginHook 0.60, (possibly 58/59 as well), calling natives using NativeFunction.CallByName<return_type> appears to be 3-4 times slower than calling them using the new calling convention NativeFunction.Natives.NATIVE_NAME<return_type>.
This manifests itself in poor framerate whenever a RNUI menu is open. My analysis suggests that the time is lost here in DisEnableControls() during its calls to ENABLE_CONTROL_ACTION and DISABLE_CONTROL_ACTION.
In my testing, refactoring this method to use the new calling convention improves the framerate significantly. (Presumably, there are other places where RNUI calls natives that may also be affected).
As of RagePluginHook 0.60, (possibly 58/59 as well), calling natives using
NativeFunction.CallByName<return_type>
appears to be 3-4 times slower than calling them using the new calling conventionNativeFunction.Natives.NATIVE_NAME<return_type>
.This manifests itself in poor framerate whenever a RNUI menu is open. My analysis suggests that the time is lost here in
DisEnableControls()
during its calls toENABLE_CONTROL_ACTION
andDISABLE_CONTROL_ACTION
.In my testing, refactoring this method to use the new calling convention improves the framerate significantly. (Presumably, there are other places where RNUI calls natives that may also be affected).