These are chat archives for ikkentim/SampSharp
NativeFunction. When you initialise this structure, you pass on the name of the native it represents and the format of the arguments, e.g.
new NativeFunction("CreateVehicle", "dffffdddb")o
new NativeFunction("GetNetworkStats", "Sd", 1).
Native.NativeName(), but for other natives, from plugins, you had to use
NativeFunctionstructure is significantly faster than
Native.CallNative, but it is slower than
Native.NativeName()(for vanilla natives).
Test with GetNetworkStats (100000x)
Direct call: 00:00:01.9585855
Test with GetGravity (100000x)
Direct call: 00:00:00.0141799
Test with Create/DestroyVehicle (100000x)
Direct call: 00:00:00.2432979