Optimizing [enums or simple variables] - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Optimizing [enums or simple variables] (
/showthread.php?tid=614225)
Optimizing [enums or simple variables] -
Shinja - 05.08.2016
Just a simple question, to experienced members
What is faster and more optimized
PHP код:
new pKills[MAX_PLAYERS];
new pDeaths[MAX_PLAYERS];
new pSpree[MAX_PLAYERS];
new pAdmin[MAX_PLAYERS];
new pVip[MAX_PLAYERS];
Or
PHP код:
enum pInfo {
pKills, pDeaths, pSpree, pAdmin, pVip
};
new Info[MAX_PLAYERS][pInfo]
Re: Optimizing [enums or simple variables] -
Sanady - 05.08.2016
From my knowledge it`s same. Just in enum thing you are packing it all in one package.
Re: Optimizing [enums or simple variables] -
Vince - 05.08.2016
Two dimensional arrays are probably slightly slower but I wouldn't be at all concerned about that. SA-MP forum members have become obsessed lately with extremely tiny and negligible optimizations. Find the real culprits with the profiler plugin and concentrate on those, instead.