SA-MP Forums Archive
Testing Script Efficiency. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Other (https://sampforum.blast.hk/forumdisplay.php?fid=7)
+--- Forum: Everything and Nothing (https://sampforum.blast.hk/forumdisplay.php?fid=23)
+--- Thread: Testing Script Efficiency. (/showthread.php?tid=615746)



Testing Script Efficiency. - DarkSkull - 26.08.2016

Hi,

So i created a Filterscript recently and I would like to see how efficient it is (testing memory, speed etc.). I'm an Amateur scripter and there a lot of things in my script that could be improved. So I would like to test my script by using different methods to perform a certain function and test it's speed and performance. If there's a way to do it, I would be happy if someone would leave a link. Thanks


Re: Testing Script Efficiency. - K0P - 26.08.2016

1.To improve the performance of your script,use different optimization methods and prevent long/many timers.
2.For testing a script,call a friend for 10 mins and test the script on local host,tell your friend to try his/her best to break the code (aka bug)


Re: Testing Script Efficiency. - DarkSkull - 26.08.2016

Quote:
Originally Posted by K0P
Посмотреть сообщение
1.To improve the performance of your script,use different optimization methods and prevent long/many timers.
2.For testing a script,call a friend for 10 mins and test the script on local host,tell your friend to try his/her best to break the code (aka bug)
Ahh. Okay. Thanks for the tip


Re: Testing Script Efficiency. - Mauzen - 26.08.2016

Theres the performace profiler plugin. Gives lots of information, including how often and how long every single function runs (but consider that the plugin actually slows the server down, its not intended to run on servers 24/7). I dont know if its still compatible with 0.3.7, but its definitely the best tool for efficiency tests and optimisation.


Re: Testing Script Efficiency. - DarkSkull - 27.08.2016

Quote:
Originally Posted by Mauzen
Посмотреть сообщение
Theres the performace profiler plugin. Gives lots of information, including how often and how long every single function runs (but consider that the plugin actually slows the server down, its not intended to run on servers 24/7). I dont know if its still compatible with 0.3.7, but its definitely the best tool for efficiency tests and optimisation.
Thanks dude


Re: Testing Script Efficiency. - SickAttack - 30.08.2016

Most things run in 0-1 milliseconds, improving things that make an insignificant "performance improvement" isn't needed or worth it. You can follow this tutorial to see how long it takes to run specific code: https://sampforum.blast.hk/showthread.php?tid=218491


Re: Testing Script Efficiency. - DarkSkull - 30.08.2016

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
Most things run in 0-1 milliseconds, improving things that make an insignificant "performance improvement" isn't needed or worth it. You can follow this tutorial to see how long it takes to run specific code: https://sampforum.blast.hk/showthread.php?tid=218491
I see. Thanks


Re: Testing Script Efficiency. - arakuta - 30.08.2016

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
Most things run in 0-1 milliseconds, improving things that make an insignificant "performance improvement" isn't needed or worth it. You can follow this tutorial to see how long it takes to run specific code: https://sampforum.blast.hk/showthread.php?tid=218491
If you run a block of code in a full millisecond, it is slow as hell.

Every single optmization is NEEDED and WORTH IT. In real life cases, this mean MONEY, a lot.

Console games wouldn't even be playable if they're not optimized during the developing phase.

Please don't say childish bullshit.


Re: Testing Script Efficiency. - SickAttack - 30.08.2016

Quote:
Originally Posted by arakuta
Посмотреть сообщение
If you run a block of code in a full millisecond, it is slow as hell.

Every single optmization is NEEDED and WORTH IT. In real life cases, this mean MONEY, a lot.

Console games wouldn't even be playable if they're not optimized during the developing phase.

Please don't say childish bullshit.
Do you even know how much a millisecond is, and how it could reach to that point? Loops? No? There's not much you could do to improve it.

People are right when they say people on this forum are obsessed with "optimizing" every single thing, when it makes a very, very tiny difference or no difference at all. It isn't needed, you wouldn't even notice the speed difference. So why even bother? Readability should be taken in first note, rather than something that's hard to read and that is "faster".