Raised This Month: $ Target: $400
 0% 

Is normal to some functions to lag randomnly?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
01101101
BANNED
Join Date: Nov 2009
Location: 9`su 09`n0n7e`r0f76a
Old 07-19-2010 , 23:30   Is normal to some functions to lag randomnly?
Reply With Quote #1

Been playin around with the profiler, and seen some weird results about the mins/max.

For example, set_task

PHP Code:
name |      calls time min max
set_task 
|     104069 0.733546 0.000000 0.030394 
remove_task
PHP Code:
remove_task |       9527 0.710004 0.000000 0.012661 
operator/(_:,Float
PHP Code:
operator/(_:,Float:) |      71562 0.026303 0.000000 0.012143 
And many other cases

PD: What I mean is, those functions should take close to nothing of time, but you can see from the "max value" that sometimes it takes a long time to execute

Last edited by 01101101; 07-19-2010 at 23:32.
01101101 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-20-2010 , 06:12   Re: Is normal to some functions to lag randomnly?
Reply With Quote #2

those functions should take close to nothing of time

And how you know ? Did you see the source code ? And you have a lot of calls in your exemple too.
__________________
Arkshine is offline
01101101
BANNED
Join Date: Nov 2009
Location: 9`su 09`n0n7e`r0f76a
Old 07-20-2010 , 16:25   Re: Is normal to some functions to lag randomnly?
Reply With Quote #3

Quote:
Originally Posted by Arkshine View Post
those functions should take close to nothing of time

And how you know ? Did you see the source code ? And you have a lot of calls in your exemple too.
How can a simple mathematical operation such as divide take 0.01 seconds?

Last edited by 01101101; 07-20-2010 at 16:31.
01101101 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-20-2010 , 17:02   Re: Is normal to some functions to lag randomnly?
Reply With Quote #4

0.01 seconds ? You do 71562 calls with a total time of 0.026303 seconds. So for one call, 0.026303/71562 = ? second. I let you to find the answer. So you find it's slow... interesting.
__________________
Arkshine is offline
01101101
BANNED
Join Date: Nov 2009
Location: 9`su 09`n0n7e`r0f76a
Old 07-20-2010 , 20:22   Re: Is normal to some functions to lag randomnly?
Reply With Quote #5

Quote:
Originally Posted by Arkshine View Post
0.01 seconds ? You do 71562 calls with a total time of 0.026303 seconds. So for one call, 0.026303/71562 = ? second. I let you to find the answer. So you find it's slow... interesting.
I'm not talking about the average (thats what you are calculating)
I'm talking about the max (AFAIK the max is the execution which took the most time).
01101101 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-21-2010 , 06:10   Re: Is normal to some functions to lag randomnly?
Reply With Quote #6

What I'm calculating is the time for one call. To calculate the average I would need to have the 71562 times, adding them, then dividing by this one.

I don't know about the max, i remember reading it's something we should not care. In this situation, I would like to know how it can be useful.
__________________
Arkshine is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 07-21-2010 , 06:23   Re: Is normal to some functions to lag randomnly?
Reply With Quote #7

The max value occurs when the server is processing something hard like entity visibility check or trace hull.
The chance of a function to take so long is so small that you can ignore it as Arkshine said.
Think that if you divide 0.733546 with 0.030394 you obtain something like 24.
So in 104069 calls a maximum of 24 are delayed so the number is too small if we compare them.
24/104069 = 2.31 * 10^(-4) this is the chance of a call to take so long. So it is too small.

Edit:
So yes it is normal for functions to lag randomly because the server has other stuff to process besides your plugin.
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
01101101
BANNED
Join Date: Nov 2009
Location: 9`su 09`n0n7e`r0f76a
Old 07-22-2010 , 17:07   Re: Is normal to some functions to lag randomnly?
Reply With Quote #8

Ok thanks
01101101 is offline
Reply



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

Forum Jump


All times are GMT -4. The time now is 07:13.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode