Just a question, in the function NewTimer (red favor) if i set an integer instead of use two times this :

JASS:

H2I(tT[0])-OFFSET

, should it be faster ?
I ask it because sometimes i need no periodic timers with 0 timeout (for an other thread).
And because i might use it in a short periodic timer, a less execution time is good to take.

But maybe it is totally irrelevant compare to the function NewTimer calling.

But put it in context, if NewTimer is your bottle neck then you are probably calling it too much. Not to mention that all the stuff inside that if (tN==0) then should not be evaluated often at all, tN==0 should be the exception, not the rule, if you add an integer local it will have to be declared before that if block, and the allocating of the variable is probably going to make it slower most of the time, not like it matters...

Your system is not unlimited - you have an implicit limit there, only that it will show itself in the form of collisions (mysterious bugs that would appear once you hit the limit), it certainly isn't faster either, in fact Red TimerUtils are much faster than it cause they get inlined.

hmm they have limit if you do not flush them that is ofc, but if you do! then they are unlimited. But in red (Timer Utils) even if you flush them there will be limit. Which is ofc hard to reach, but that hard to reach generates a lot of global variables (size/JASS_MAX_ARRAY_SIZE) i think thats the number. I did not understand the part that they have mysterious bugs. Ok ill explain how my system works!

Every handle has its own id! Every next generated object has id+1.
If we know that and max size of array which is from 0 to 8191 not 8192.

Then (object id mod 8192) = somewhere in the range from 0 to 8191 mod will never return 8192.

Now when we have that id we can store it.

For next id+1 it will store in array+1. It does not matter where (at which) id they start, because they loop and yes you are right they will not work if you store 8191 objects (example at id of 1000) -> you store object then it goes to 8191 -> loops to 0 -> goes to 999 and next one will not be stored. Why because you did not flush them.

Quote:

Originally Posted by Vexorian

in fact Red TimerUtils are much faster than it cause they get inlined

If thet is true so my are not inlined well for that part your might be faster, but such long variables list use functions? so are they inlined if they are then lol using array more then 8191 is ok with me sorry did not know that array gets inlined. And ofc because my dont get inlined, but still are you sure that my system is so bad as you said, and that your is so good.

I never said yours bad, i just got an idea on how to make my own stuff...

However i never wanted that anyone uses my stuff, but i am interested a lot in learning stuff. So please explain me how this mysterious bugs happen and how is this not unlimited if you flush it?

The problem exists, Dark_Dragon, when handle indexes are never released and they slowly start climbing. What will happen is that you may have a handle that gets the same storage index as a previously stored handle that is still in use. When this happens, you will over-write the index and cause the first handle to bug. Stuff like this is rather disgusting to debug and would rather be avoided.