[Pawn] Opinion on PVars - Printable Version + open.mp forum (https://forum.open.mp) -- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3) --- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10) --- Thread: [Pawn] Opinion on PVars (/showthread.php?tid=2098) |
Opinion on PVars - Pinch - 2021-06-05 Hi everyone, I've gotten bored so I started writing a gamemode for fun, I want it to be a RolePlay gamemode with all of the stuff (like the NG-RP) but I want it to be smooth on bigger player base too.. I ran some tests and those were the results Code: Timing "PawnPlus list"... The code I used: Code: new List:pp_list[1000]; So, is it worth it? Should I use PVars/PP lists? Does it even matter that much when the diff is 200ns? RE: Opinion on PVars - IllidanS4 - 2021-06-05 The question is incomplete. Use X for what? All 3 features have other differences, and are suited for other things. PP lists are resizable; PVars are maps (so PP maps would be better in a comparison), plus their lookup is linear so the difference will only become apparent for a larger collection. And the difference should be interpreted in another way. It doesn't matter at all what the absolute difference is for a single call, you should be looking at how it scales. So for 1000 calls it will be 200 ?s and so on. But I don't think it matters (for this specific use case) that much since twice slower is still more or less within the same order of magnitude. RE: Opinion on PVars - Pinch - 2021-06-05 Hmm, I want to store the user data so that's why I tested it this way..???? RE: Opinion on PVars - Y_Less - 2021-06-05 He is just saying that your test isn't big enough. You're only testing 3 writes to three variables, you need more like 100. |