| 05-20-2008, 07:43 PM | #1 |
i know what .execute do exactly but is it faster than ExcuteFunc ? i think not because it call a function which call an execute of a trigger. So it should have a feature in vJass that i don't know ? |
| 05-20-2008, 08:27 PM | #2 |
ExecuteFunc is very slow. .execute is faster, and .evaluate faster still (but evaluate does not allow you to use waits). |
| 05-20-2008, 08:31 PM | #3 | |
Quote:
Thx for the answer |
| 05-20-2008, 08:33 PM | #4 | ||
Quote:
Is there a source for this? I recall reading something about .execute being faster, but all the manual says is: Quote:
Which seems to say that both are faster than ExecuteFunc, but little more. |
| 05-20-2008, 10:23 PM | #5 | |
Quote:
|
| 05-20-2008, 10:57 PM | #6 |
ExecuteFunc lamenizes your script, .execute doesn't. When I end up adding the shortest name optimization to jasshelper, ExecuteFunc will prevent this new jasshelper optimization from being called. Yes, as a matter of fact, I am just about to begin a massacre against scripts that use ExecuteFunc or TriggerRegisterVariableEvent, or whatever that lame real variable stuff is. Edit: .execute() on a "takes nothing returns nothing" function just got as fast as TriggerExecute since jasshelper 0.9.A.0 . According to pipedream TriggerExecute is 2 times faster than ExecuteFunc, so make up your decision. |
| 05-21-2008, 10:44 AM | #7 |
just tested. ExecuteFunc("XXX") - ~28x TriggerExecute(trg_XXX) - ~21x so yeah it's better. but in fact. TriggerEvaluate is much better. |
| 05-21-2008, 11:14 AM | #8 |
I would say the result will change if you add 100 functions before TriggerExecute. These TriggerEvaluate/Execute benchmarks always seem to vary this much. |
| 05-21-2008, 11:21 AM | #9 | |
Quote:
Bah, all this time I thought it was the other way around. |
| 05-21-2008, 11:31 AM | #10 |
TriggerEvaluate doesn't create another thread, so it is pointless to compare it with the Execute dudes. .evaluate() is also optimized recently to use TriggerEvaluate() directly (provided the function takes nothing returns nothing) |
| 05-21-2008, 11:53 PM | #11 | |
Quote:
loop exitwhen i>1000 // do xxx set i=i+1 endloop so it have more realistic stress situation imitation xD (sound lol) |
| 05-22-2008, 12:01 AM | #12 |
The number of times you call ExecuteFunc has nothing to do with the number of functions in the script. It might actually be less realistic anyway -> in real life you would actually only call it once in a while, and there are caching stuff hidden in the OS and architecture that change the proportion when calling something 1000 times. |
| 05-22-2008, 12:03 AM | #13 |
Didn't even know this was in VJass... So instead of JASS:call ExecuteFunc("SetupImages") it would be JASS:call .execute("SetupImages") And does .execute create a new thread? (The whole reason I'm using a function execute.) |
| 05-22-2008, 12:05 AM | #14 | |
Actually: JASS:call SetupImages.execute() Quote:
It typically becomes something like this: JASS:call TriggerExecute(t__somename[7] ) |
