SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 23/07/2011, 03:56 PM   #21
leong124
High-roller
 
leong124's Avatar
 
Join Date: Jun 2008
Location: Hong Kong, China
Posts: 1,566
Reputation: 134
Default Re: Performance profiler

robanswe: Try to use the binary search method to comment out parts of your script, and see which part of it does the recursion.

Zeex: I got a problem. When I check the output of this plugin, I found that there are 19 Itter_OnGameModeInit there while there's about 4-5 hooked OnGameModeInit only in my gamemode.
Also, all of them are Itter_OnGameModeInit, while they should have different names IMO (since they are hooked with different names and get called like a chain).
Finally thanks for taking my suggestion
__________________
[KDT_MS]hk_shade

Sorry for my bad English and my weakness in expressing myself.
leong124 is offline   Reply With Quote
Old 23/07/2011, 04:13 PM   #22
robanswe
Huge Clucker
 
Join Date: Oct 2007
Posts: 372
Reputation: 26
Default Re: Performance profiler

Quote:
Originally Posted by leong124 View Post
robanswe: Try to use the binary search method to comment out parts of your script, and see which part of it does the recursion.

Zeex: I got a problem. When I check the output of this plugin, I found that there are 19 Itter_OnGameModeInit there while there's about 4-5 hooked OnGameModeInit only in my gamemode.
Also, all of them are Itter_OnGameModeInit, while they should have different names IMO (since they are hooked with different names and get called like a chain).
Finally thanks for taking my suggestion
Ty I tryed that but it will also take ages. But I might have an other idea when I look at the result of this plugin this stands out:
Code:
Function 	                        Calls 	               Time per call, Ás 	         Overall time, Ás 	    Overall time, %
operator<=(Float:,Float:)   	      16 	                    59813777819859 	                957020445117739 	    99.65


Can this be the problem? If so what the hell is "operator<=(Float:,Float: )"? Where can I find the function?









Edit:

I fixed the warning problem but I still got the problem that it seems like the data I get from this plugin is WAY wrong.. Just look at this:

Code:
Function 	                            Calls 	                  Time per call, Ás          	Overall time, Ás 	           Overall time, %
operator<=(Float:,Float:) 	            10 	                      1767756274039915 	         17677562740399150                   99.99
ContainsIPEx 	                            10 	                      147201389626 	                  1472013896257 	                   0.01
operator-(Float:,_:)                        1 	                              2990482326 	                   2990482326 	                           0.00
operator!=(Float:,Float:) 	             69 	                       1718595953 	                   118583120736 	                  0.00
operator>=(Float:,_:) 	             279 	                       3136081 	                           874966490 	                          0.00

Just look at the total time o.0 When I ******d that I found out that 1767756274039915 Ás is about 56 YEARS! I did only run the server for 10 mins so 56 years is kinda impossible....
__________________

Last edited by robanswe; 23/07/2011 at 07:59 PM.
robanswe is offline   Reply With Quote
Old 24/07/2011, 07:43 AM   #23
0x5A656578
Guest
 
Posts: n/a
Default Re: Performance profiler

I'm currently trying to fix an important bug which can sometimes mess up everything (this is related to Call[Local/Remote]Function and calling public from outside in general), and I guess the impossibly-huge-numbers problem has something to do with that
  Reply With Quote
Old 24/07/2011, 08:27 AM   #24
robanswe
Huge Clucker
 
Join Date: Oct 2007
Posts: 372
Reputation: 26
Default Re: Performance profiler

Quote:
Originally Posted by 0x5A656578 View Post
I'm currently trying to fix an important bug which can sometimes mess up everything (this is related to Call[Local/Remote]Function and calling public from outside in general), and I guess the impossibly-huge-numbers problem has something to do with that
That's good to hear Also isn't it possible to fix so you can see standard public functions like: public OnPlayerUpdate(playerid) or public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) ? Because that would be extremely nice to know how fast they are.


Edit:
One more thing that would be great is if you can add support for monotoning many scripts at the same time. Like: Profiler_Init("gamemodes/lvdm.amx","filterscripts/test.amx");
__________________
robanswe is offline   Reply With Quote
Old 24/07/2011, 04:44 PM   #25
0x5A656578
Guest
 
Posts: n/a
Default Re: Performance profiler

I have finished a new version (v2.0 alpha):

https://github.com/downloads/Zeex/pr...filer-2.0a.zip (only Windows version for now)

Changes:
  • Publics are profiled correcly (I hope), including callbacks and those called via CallLocalFunction and CallRemoteFunction
  • Now you don't have to call any Profiler_* functions (they are simply deleted), you just add scripts to the file located in <server>/plugins/profiler.cfg, one per line, e.g.
    Code:
    gamemodes/lvdm.amx
    filterscripts/fsdebug.amx
    filterscripts/adminspec.amx
  • Directory separators in profiler.cfg are significant - on Windows you use '\' and on Linux you put '/' (maybe I will fix this later)
  Reply With Quote
Old 24/07/2011, 05:18 PM   #26
robanswe
Huge Clucker
 
Join Date: Oct 2007
Posts: 372
Reputation: 26
Default Re: Performance profiler

Quote:
Originally Posted by 0x5A656578 View Post
I have finished a new version (v2.0 alpha):

https://github.com/downloads/Zeex/pr...filer-2.0a.zip (only Windows version for now)

Changes:
  • Publics are profiled correcly (I hope), including callbacks and those called via CallLocalFunction and CallRemoteFunction
  • Now you don't have to call any Profiler_* functions (they are simply deleted), you just add scripts to the file located in <server>/plugins/profiler.cfg, one per line, e.g.
    Code:
    gamemodes/lvdm.amx
    filterscripts/fsdebug.amx
    filterscripts/adminspec.amx
  • Directory separators in profiler.cfg are significant - on Windows you use '\' and on Linux you put '/' (maybe I will fix this later)
Great but how to save the result now then? It seems like you have removed: Profiler_PrintStats();
__________________
robanswe is offline   Reply With Quote
Old 24/07/2011, 05:23 PM   #27
0x5A656578
Guest
 
Posts: n/a
Default Re: Performance profiler

Quote:
Originally Posted by robanswe View Post
Great but how to save the result now then? It seems like you have removed: Profiler_PrintStats();
OK seems like I missed this - it saves the result to the same directory where the script is, and adds .prof to the filename, e.g. gamemodes/lvdm.amx.prof. Don't worry about the extension - it's still HTML, just open in a web browser like before.
  Reply With Quote
Old 24/07/2011, 05:26 PM   #28
robanswe
Huge Clucker
 
Join Date: Oct 2007
Posts: 372
Reputation: 26
Default Re: Performance profiler

Quote:
Originally Posted by 0x5A656578 View Post
OK seems like I missed this - it saves the result to the same directory where the script is, and adds .prof to the filename, e.g. gamemodes/lvdm.amx.prof. Don't worry about the extension - it's still HTML, just open in a web browser like before.
When does it save it because I can't find it?
__________________
robanswe is offline   Reply With Quote
Old 24/07/2011, 05:28 PM   #29
0x5A656578
Guest
 
Posts: n/a
Default Re: Performance profiler

Whenever script gets unloaded, try doing gmx or reloadfs
  Reply With Quote
Old 24/07/2011, 05:33 PM   #30
robanswe
Huge Clucker
 
Join Date: Oct 2007
Posts: 372
Reputation: 26
Default Re: Performance profiler

Quote:
Originally Posted by 0x5A656578 View Post
Whenever script gets unloaded, try doing gmx or reloadfs
Idk what I'm doing wrong I have tried both gmx and exit and I doesn't get any file. I have created an file profiler.cfg in the plugin fouler with this: gamemodes/lvdm.amx on the first line. Btw I'm on w7 64bit with no UAC.
__________________
robanswe is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Timers performance Zamaroht Scripting Help 5 30/08/2012 09:29 AM
Bad performance on a great PC Juan Dover Client Support 20 13/02/2011 07:34 PM
Performance issues gamer931215 Everything and Nothing 3 26/08/2010 09:54 PM
SQL performance Dabombber Help Archive 7 24/09/2009 03:49 PM
9400 GT - GTA:SA Performance rafay Everything and Nothing 14 09/06/2009 04:23 PM


All times are GMT. The time now is 04:00 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.