Closed kagikn closed 1 year ago
I would need to test this, as only SHVDN has a proper .NET Framework implementation. Everything else is a bodged version of Mono and .NET Core as far as I know.
Couldn't test RageMP, as C# is quite a bit broken over there. I was able to test everything else.
RagePluginHook: Works
ScriptHookVDotNet: Works
FiveM: Works
Uh, a ~Helmet~ Performance Inspection Officer.
When checking if some collections that has about 10 or more elements contains some other elememts, HashSet does the job fast (arrays or array lists would search faster if there are only like 2 elements). And get rid of redundant
Controls.IsUsingController
calls from theif (DisableControls)
block since the result won't be changed and native calls are relatively expensive even without thread switching that was happened in SHVDN. Also explicitly callDispose
onOutputArgument
so the finalizer won't be called.If you don't mind using unsafe blocks, we could get rid of the use of
OutputArgument
so no dynamic heap allocation won't happen just for 4 byte values.