HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Which of these if the fastest

06-23-2008, 10:36 PM#1
the-thingy
I'd like to know what is the fastest method of going through a number of structs/any other things, with regards to timers

A - Looping through a series of (whatevers) on a single timer i.e.
Collapse JASS:
local integer i = Count
loop
exitwhen i <= 0
//etc

B1 - Attaching the data to separate timers using HSAS
B2 - Attaching the data to the same timer using HSAS (if that's possible)

C1 - Same as B1, using HAIL
C2 - Same as B2, using HAIL (again, is it possible?)

D1 - Same as B1, using ABC
D2 - Same as B2, using ABC (,again is it possible?)

E - Timer Ticker

F1 - B1 using gamecache
F2 - B2 using gamecache (again, is it possible?)

G - Any other attachment systems involving timers :P
06-23-2008, 10:54 PM#2
Veev
Toadcop?
06-24-2008, 12:20 AM#3
grim001
A is by far the fastest
06-24-2008, 12:35 AM#4
Dark.Revenant
Simpler = Faster.

Always. Unless, of course, you have grotesquely bottlenecked hardware...
06-24-2008, 01:13 AM#5
TheDamien
A is the fastest, possibly followed by E.
06-24-2008, 08:59 AM#6
the-thingy
Thanks for that :)

@Dark.Revenant: Not 100% sure on what you're saying
06-24-2008, 09:05 AM#7
The Elite
unless you have fucked up computer hardware
06-24-2008, 09:16 AM#8
the-thingy
I was talking about the simpler = faster bit :P Faster in what way? In coding the stuff, or in how fast the code works when it is actually used?
06-24-2008, 09:24 AM#9
chobibo
10 year old PC
06-24-2008, 10:56 AM#10
Themerion
If you can make the thing with a single timer, then A (without the array) would be best performance (since you wouldn't need attaching).

Collapse JASS:
private struct Data
    Data next
    // Any other variable you need.
endstruct

globals
    Data first
endglobals

function Loop takes nothing returns nothing
    local Data d=first
    loop
        exitwhen d==0
        // Do stuff with your varaibles.
        set d=d.next
    endloop
endfunction

If you need multiple timers, you need to attach. HSAS/CSData is fastest.
06-24-2008, 12:13 PM#11
Vexorian
If you had really a lot of objects used by the same timer, like 750 or 1000, A would give you a very high fps, the problem is that it is not preemptive , so regardless of the high fps the players will feel like it periodically freezes. Something with attaching will in that case really make the game slower, but the players would actually feel better playing it since at least the game speed is consistent.
06-24-2008, 12:50 PM#12
the-thingy
@Vexorian: But what if the number of objects is much lower... in the region of <= 100 (that'd be an absolute maximum IMO). Would the periodic freezing be noticeable, or would that vary depending on the player's PC?

@Themerion: I know how to do the loop :)

Quote:
If you need multiple timers, you need to attach. HSAS/CSData is fastest.
Hmmm, isn't HAIL as fast as HSAS? I remember someone telling me that there was little/no speed difference between the two :P

Anyway, if multiple timers aren't as fast as a single timer, I will just stick to a single timer
06-24-2008, 01:51 PM#13
Vexorian
Quote:
@Vexorian: But what if the number of objects is much lower... in the region of <= 100 (that'd be an absolute maximum IMO). Would the periodic freezing be noticeable, or would that vary depending on the player's PC?
I got in that situation a lot of times and it wasn't noticeable.
06-24-2008, 02:11 PM#14
the-thingy
So, if I was looping through 10 slide instances at any one time, a single timer with a loop would be the best way to go?

Or would this be one of those 'do whatever you think is best' kinda things, where the differences are minimal?
06-24-2008, 03:29 PM#15
Themerion
Quote:
Hmmm, isn't HAIL as fast as HSAS? I remember someone telling me that there was little/no speed difference between the two :P

Yeah, HAIL is approximately equal to HSAS. CSData will probably be more common to use though (since it comes bundled with the Caster System).

Attachment Systems:
HAILCSDataHSASABC
Fast H2I-array lookups?YesYesYes-
Hashing?When fast-array is full.--Yes, always.
Instanceable by text-macros? Yes-YesYes

For attaching to units, I think PUI is superior.

Quote:
Originally Posted by the-thingy
So, if I was looping through 10 slide instances at any one time, a single timer with a loop would be the best way to go?

Yup.

Quote:
Originally Posted by the-thingy
Or would this be one of those 'do whatever you think is best' kinda things, where the differences are minimal?

Yup.