System TMAAS (Textmacro Abusing Attachment System)

Gwypaas

hook DoNothing MakeGUIUsersCrash
Reaction score
50
If you want a benchmark for it, then here it is.

As you see, my system is alot faster then HSAS.

And this is ALOT faster then Timerutils (blue) since this uses a default array for id's less then 8191. It's the same speed as Timerutils (blue) for higher ids.
 

Attachments

  • JASS Benchmark 1.2.w3x
    23.5 KB · Views: 176

Flare

Stops copies me!
Reaction score
662
I'm getting syntax errors with that xD

The benchmark's internals after your system
JASS:
function Trig_Run_Script_Thread_0 takes nothing returns nothing
 local integer i= 1
 local integer j= udg_zzExecutions_Per_Thread / 10
	set udg_zzScriptThreadOpen = true
	loop
		exitwhen i > j
call  // INLINED!!
call  // INLINED!!
call  // INLINED!!
call  // INLINED!!
call  // INLINED!!
call  // INLINED!!
call  // INLINED!!
call  // INLINED!!
call  // INLINED!!
call  // INLINED!!
		set i = i + 1
	endloop
	set udg_zzScriptThreadOpen = false
endfunction

:p

That // INLINED!! function sounds awesome :D

EDIT: Oh wait, that's because TestScript0 isn't being used xD

EDIT: Oh wait, it's happening to all the scripts that only have a return - wonder why it happens to me and (seemingly) not to you - I'll just place some random function in there :)
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
I think your SetDecrease and init function looks better like this? (It also has one less handle. ;)):

JASS:
private function SetDecrease takes nothing returns nothing
    set TMAAS_DECREASE = TMAAS_H2I(GetExpiredTimer())
endfunction

private function init takes nothing returns nothing
    call TimerStart(CreateTimer(),0,false,function SetDecrease)
endfunction


Also, I don't really see why this is a "Textmacro Abusing" attachment system. It's just a simple handle array. Does it even recycle the arrayed handles?
 

Romek

Super Moderator
Reaction score
963
> Darthfett
The function would have to return nothing for that to work. :D
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
> Darthfett
The function would have to return nothing for that to work. :D

Very true. :p (fix'd!)

Anyways, I don't know much about how recycling handles works, but I thought if you didn't null a handle it leaked. With this system, you're keeping an array of all the handles ever stored (correct?). Wouldn't that cause potential memory problems?
 

Gwypaas

hook DoNothing MakeGUIUsersCrash
Reaction score
50
Updated
Changes - Remade the init function (Thought of it before your post Darthfett xD) also improved documentation.

Anyways, I don't know much about how recycling handles works, but I thought if you didn't null a handle it leaked. With this system, you're keeping an array of all the handles ever stored (correct?). Wouldn't that cause potential memory problems?
Only 2 integer arrays.

Also, I don't really see why this is a "Textmacro Abusing" attachment system. It's just a simple handle array.
The only system out that uses textmacros for attaching / Retrieving :)

Does it even recycle the arrayed handles?
Why should it recycle them? There's absolutely no point in trying to recycle an integer array.
 

Romek

Super Moderator
Reaction score
963
The only system out that uses textmacros for attaching / Retrieving :)
Maybe because others thought it was a bad idea. :rolleyes:.
It is fast however. No denying that.

Also, When setting DATAZBIG, you could set the index to index - 8191.
So that you're not wasting that entire array in the oversized ones.
(You are using a different array for ones <8191)
 

Gwypaas

hook DoNothing MakeGUIUsersCrash
Reaction score
50
Would be slower (I think it will) and what's the difference between 409500 and 400000 array slots? Your map still breaks before that value :)
 

Romek

Super Moderator
Reaction score
963
Would be slower (I think it will)
That depends if subtracting a value, then doing 1 if-check is slower than doing 2 if-checks. (And subtracting + 2 ifs is slower than 3 ifs, etc)

Scenario A: What you're doing now
Scenario B: What I'm suggesting

JASS:
//Assume index was 10000, and 8191 was subtracted for B
if index &lt; 8191 then // A: false. // B: true
return ARRAYA[index] // B: function finishes.
elseif index &lt; 16382 then // A: true
return ARRAYB[index-8191] // A: function finishes. (And there&#039;s a subtraction anyway)
//etc.
endif

(Taken from post above)
 

Gwypaas

hook DoNothing MakeGUIUsersCrash
Reaction score
50
Yeah I know...

I might inline the oversized arrays to make it faster but.. it would look fugly :D
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top