Quick Speed Fact

Nestharus

o-o
Reaction score
84
Relativity is man's best friend =).



But for a string initialization... to radically change results.... is mysterious o-o


Someone should investigate that matter (not me).

: D


But you are telling me that code running on one thread is in fact faster than code running on another thread? The same exact code?

Wow.... so.... what do we do?? : (
 

Jesus4Lyf

Good Idea™
Reaction score
397
>Wow.... so.... what do we do?? : (
Give up. And never start a thread like this again. :)

It appears quite simply that variables internally have varying complexity. Which I knew. Which is why I didn't condone it, and why I said do those other tests.

That improvement I've mentioned twice now should have been obvious, but still hasn't been used.

Are we settled to conlude that one thing from this thread - that variables have varying complexity based on circumstance?
 

Nestharus

o-o
Reaction score
84
>Wow.... so.... what do we do?? : (
Give up. And never start a thread like this again. :)

It appears quite simply that variables internally have varying complexity. Which I knew. Which is why I didn't condone it, and why I said do those other tests.

That improvement I've mentioned twice now should have been obvious, but still hasn't been used.

Are we settled to conlude that one thing from this thread - that variables have varying complexity based on circumstance?


but how would using the same variables... in two dif threads... make the tests bad... if we look at things relative to each other -.-


I didn't use local variables when I performed the test, everything was global. I split operations up between different threads, so it should have stayed relative. To me, I think the benchmarks I took on the natives vrs array speeds in basic form were accurate. However, as for testing variables as compared to globals... Personally, I feel at this point that globals should always be used over locals :\. Also, single globals are merged into an array (from the results we've seen) =). It's probably the same case with single locals (but a more complicated stack).


Another thing that we know is that variables can be accessed via a string. You can retrieve the name of a variable etc. Global variables also fire off events (locals don't). Everything that is global (functions and vars) are part of some sort of map memory.



We need to look at the results of the tests and see what's happening. You say that this thread was pointless, but I disagree =). It clearly shows some of how wc3 operates.


I don't believe that Troll-Brain's code was well to do because of the reasons I described above. My tests used the exact* same variables. My tests didn't include a local variable factor.



Now, the only mystery to me is why on earth a string initialization before the use of a stopwatch would so radically change results given that it is in a separate variable. You say that variables are more complex factors, but the string just points to the regular C++ literal string table... so that makes no sense, unless Blizzard did more of its extra senseless mumbo jumbo that they always seem to do -.- rather than just plain old " ".


Oh well, those are my thoughts on the matter =)
 

Jesus4Lyf

Good Idea™
Reaction score
397
>Personally, I feel at this point that globals should always be used over locals
For speed freaks who don't care about readability much (me), yeah, I agree. However, this utterly fails for recursive functions (think damage on damage events) so the author better be darn sure it will never be recursive (ie it's incapable of firing any sort of event, or doesn't reuse variables after it may be fired, etc).

This will not be standard practise for the reasons above. Feel free to do it yourself.

Believe me when I say it is very hard debugging a map written that way. >_<
Things like this cause projects to stop. :thup:

>Also, single globals are merged into an array (from the results we've seen) =). It's probably the same case with single locals (but a more complicated stack).

Your assumptions disturb me. The same speed appearing for the two in some random test does not insist the cause is what you stated. Don't parade it as a fact, thanks. :)
 

Nestharus

o-o
Reaction score
84
Notice I said from the results we've seen =)


It probably needs more testing, but it seems quite odd that they'd be the same speed. Really though, i don't see any way to test it unless someone was to declare about 17,000 globals :\, and even then we couldn't be sure unless we had a very substantial amount, like 60-80k : |.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Nestharus said:
Those were the points i was tying to make =).

Jesus4Lyf said:
And you failed to make them, instead sounding like an arrogant idiot. (I think you're better than that.)
This.

I perfectly know how to use the R2SW native, thx.
It's just faster to write and in fact works like it should, even the multiplication.
But i'm agree * 10. was not enough here.

Also i didn't see anything wrong with the TriggerRegisterPlayerEventEndCinematic, i mean who care about the speed gain here ...
It's not like you will create this kind of trigger each 0.0001 s ...
For me i'ts more readable and faster to write than that :


I'm not an all-anti-BJ dude.

I tried what Jesus4Lyf suggested, and have used only globals variables instead of locals ones, same result.
It's about the same speed. There is only 1 % or so of difference and the fastest is always the first test.
So i guess the japi natives are just 1% inaccurate here.

I'm totally agree with Jesus4Lyf, and no i don't believe in ExecuteFunc.

Last thing :

Nestharus said:
I guess me, jesus4lyf, and all of the other people who have ever benchmarked before are just uber newbz compared to ur plain awesomeness

AFAIK, you were only the one here which benchmarked in this thread, but i can be wrong, i simply don't know it, and in fact i couldn't.

EDIT : And if you talked about Azlier he tested only with 1000 iterations, which should be inaccurate.
 

Nestharus

o-o
Reaction score
84
in my tests to be honest, when i first put up this thread i got the same result as you with my methods. However, as I keep pointing out, I initialized a string var before hand afterwards and got totally different results. I found it very odd that the natives would be faster, so I figured the init string result was the correct one.

ExecuteFunc is fine. Like I keep saying, giving a string an initialized value seems to change everything O-o.

don't believe me? try it out for yourself =)
 

Jesus4Lyf

Good Idea™
Reaction score
397
>ExecuteFunc is fine. Like I keep saying, giving a string an initialized value seems to change everything O-o.
I thought it was obvious that that means it is not fine.

I trust Troll's results. He did what I suggested, and found what I expected.

Why do you tell us ExecuteFunc gives unstable times and also tell us it is fine for benchmarking in the same line?
 

Nestharus

o-o
Reaction score
84
i'm saying that if you initialized a string in any case it'd give wild results =o.

then again, i didn't test, i just assumed now that i think about it ^-^.
 

Azlier

Old World Ghost
Reaction score
461
Do. Not. Use. ExecuteFunc. In. Benchmarks.

Very bad.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
GetLocalPlayer against LocalPlayer.

Again it's about the same speed and the order of the test does matter.


GetLocalPlayer tested first -> LocalPlayer is slightly faster.
LocalPlayer tested first -> sometimes it's GetLocalPlayer the fastest but most of the times it's LocalPlayer, still slightly though.

So maybe using a global variable would be very slightly faster than using GetLocalPlayer.
I'm wondering how would be the result in a multiplayer game though.

Moral :

Start a map instead instead of worry of these irrelevant things :D
 

Nestharus

o-o
Reaction score
84
Moral:
you mean start using the expensive game engine you bought instead of Warcraft Nestharus. What the hell are you thinking Nestharus. Actually make some money and make a real game Nestharus you stupid little foo : o.

Nestharus:
/cry

Person:
Yes, you cry... and get to work on that game >: O

Nestharus:
/cry

Person:
YOU HAVE A WEBSERVER TOO?? BUT YOU AREN'T EVEN WORKING ON YOUR WEBSITE?? DONT YOU KNOW C#, PERL, PHP, XHTML, etc, ALL THE STUFF NEEDED FOR WEB DESIGN!!!! WTH ARE YOU DOING??

Nestharus:
playing wc3 : (

Person:
Why...

Nestharus:
It's fun..

Person:
But you can make your own game, your own website, your own music, your own everything... Why are you on Warcraft 3 still

Nestharus:
I... i...

Person:
You...?

Nestharus:
I...

Person:
You...?

Nestharus:
:confused:

What were you asking?


Person:
:banghead:


-------------------------------------------------
In short, I don't do this stuff for my benefit. I do it for others. Most of my actions are based on a desire to help others. People always ask, why do so many talented programmers or people who know what they are doing ever do anything like make a map or make this. Why are they always stuck making resources for other people to use? They aren't stuck, they want to help =).

Do you want to know something interesting? When it comes to leadership, I'm like a natural born super leader person : O. Do I ever lead though? No. I mainly play the role of the Super Adviser Hero >: O. Why? I try to help others become great leaders. For me, I gain absolutely no benefit out of being a leader. I don't learn anything and I don't grow in any way. Whether I have 100 years of experience or 10 minutes of experience, I'm going to be the same, so there's really no point =). Sure, the team gets benefit, but I'd rather have someone else grow out of it and guide them to the right choices ^_^.


It's like making a resource for a game or w/e. Sure, you can make the resource and use it for yourself, but then you are the only one getting a benefit out of it ; \. Sure, you can make a game, but what about other people making their games and their dreams. Sure this, sure that... in the end, I suppose I try to pass on my knowledge and discoveries to others =).


So why don't I make a map or a real game? That is why =). Sure, some day I will, but it'll be a very slow journey and it will end with a lot of friends and people I've helped out ^_^, and together we'll all make an epic masterpiece =D.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Isn't that a monologue?
Yep, and it's the first step before getting crazy, or he is schizophrenic and then it's a dialog.

We also have to don't ignore completely the little possibility that it could be a joke or something.
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
Can someone benchmark reading/writing to a struct's array member vs using a hashtable?

IE. [LJASS]struct.array[int][/LJASS] vs [LJASS]LoadInteger(arraymembers,struct,int)[/LJASS]
And the same for writing.

Hashtables could win...

htvsstructmem.jpg

:nuts:

Some info :
Struct's index/Hashtable's parent key = 0

Array index/Hashtable's child key = 8
 

Jesus4Lyf

Good Idea™
Reaction score
397
Looks like you used Bob666's, not the stopwatch natives. But I don't mind that.

Your results are correct if integer math is particularly fast (makes sense).

Still, would be nice to see a stopwatch native test... I think bob's test slightly favors arrays over native code. Unsure.

Thanks. ^_^ (Have to spread rep, lol.)
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Still, would be nice to see a stopwatch native test...
You can make the code yourself ^^
If you do it, i will test it or someone else for sure.

Also why you can't use the stopwatch natives ?

I did a fast one and for reading, hashtables are 1.7 time slower than global arrays.
And faster or about the same speed than vJass extended array, in most of cases.
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
I believe there is no stopwatch native for current 1.24b version.
Before it, I can't get work with stopwatch in 1.21b, Warcraft does not load the map, anyway.
 
General chit-chat
Help Users
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/
  • The Helper The Helper:
    Here is another comfort food favorite - Million Dollar Casserole - https://www.thehelper.net/threads/recipe-million-dollar-casserole.193614/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top