AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Benchmarking : register_think, register_touch VS register_forward(FM_Think/FM_Touch) (https://forums.alliedmods.net/showthread.php?t=61219)

hebusletroll 09-24-2007 11:14

Benchmarking : register_think, register_touch VS register_forward(FM_Think/FM_Touch)
 
Dears Friends.

I have a question about run time efficiency with engine methods and fakemeta methods.

With engine, it's possible to register an entity think or touch by inputing the ClassName as a filter, and trig easily a delegate function. Ok.

With Fakemeta, registering purpose that we must catch ourself the class name by doing theses features :

=> Allocating predefined string variable, dedicated to read the class name with pev function.

=> When it's done, we must compare collected value with classname we want to compare, with equali...

=> ... and calling function used when the name is matched.

I'm afraid that adding a lot of classname comparaison will take more cpu time than the engine methods. Isn't it ?

I think this is a good investigation no ? What do you think about this ?

Yes I LOVE FAKEMETA and i want no longer use engine methods, but for theses cases, engine is always more efficiency ?

"Voily voilou" ;o)

danielkza 09-24-2007 13:34

Re: Benchmarking : register_think, register_touch VS register_forward(FM_Think/FM_Tou
 
Actually,the only difference is that engine compares the names itself,with fakemeta you can choose what to do,filter by entity id,etc.And remember to use statics to help performance a bit.

Wilson [29th ID] 09-24-2007 17:53

Re: Benchmarking : register_think, register_touch VS register_forward(FM_Think/FM_Tou
 
I would reckon that if you look at the engine module's source code it's doing roughly the same thing.


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

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