Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Performance difference between GTA V version 372 and 393
- Calling SET_CURRENT_PED_WEAPON 1000 times via ScriptHookV and RAGEPluginHook (code used is provided below):
- 372: ~582ms (RPH: ~585ms)
- 393: ~2480ms (RPH: ~2490ms)
- Performance on version 323/350 is most likely even better due to even less/no obfuscation than 372.
- Code used for ScriptHookV (performance counter code from http://stackoverflow.com/questions/1739259/how-to-use-queryperformancecounter):
- Ped playerPed = PLAYER::PLAYER_PED_ID();
- uint weaponHash = 0xA2719263;
- StartCounter();
- for (int i = 0; i < 1000; i++)
- {
- WEAPON::SET_CURRENT_PED_WEAPON(playerPed, weaponHash, true);
- }
- double timePassed = GetCounter();
- char buffer[32];
- sprintf(buffer, "Time passed: %f", timePassed);
- MessageBoxA(0, buffer, "", 0);
- Code used for RPH:
- System.Diagnostics.Stopwatch Stopwatch = new System.Diagnostics.Stopwatch();
- uint playerHandle = Game.LocalPlayer.Character.Handle.Value;
- Stopwatch.Restart();
- for (int i = 0; i < 1000; i++)
- {
- Rage.Native.NativeFunction.CallByHash<ulong>(12535367907453402124uL, playerHandle, 0xA2719263, true);
- }
- Game.LogTrivial("Time spent on 1000 calls: " + Stopwatch.ElapsedMilliseconds);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement