Aller au contenu

Photo

Technical Question - GetObjectByTag or...


  • Veuillez vous connecter pour répondre
59 réponses à ce sujet

#51
henesua

henesua
  • Members
  • 3 858 messages
So... has anyone clocked GetWaypointByTag?

#52
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
The only thing that I know of being done is the test that funky already did and posted on. More of just a compairsion test then anything?

#53
henesua

henesua
  • Members
  • 3 858 messages
Funky did a test of GetWaypointByTag versus GetObjectByTag?

All I saw was that he planned to do one at some point, but I don't see the results of the test anywhere.

#54
Shadooow

Shadooow
  • Members
  • 4 465 messages
logically GetWaypoint should be faster, but who knows?

And I wouldnt be very trustful to the "clocking results", one day its this and the other day that.

For example in past someone (not sure who unfortunately) clocked OBJECT_SELF, and said that while its indeed macro and not constant its faster than being assigned into variable before.

Year ago, The Krit claims otherwise. Not sure where he get this, in nwn wiki there is no proof for this, but you can see my point.

Modifié par ShaDoOoW, 08 janvier 2012 - 11:55 .


#55
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
Funcky did his test in this post. Stating that "I may not have to do any others."

My opinion on the OBJECT_SELF question.   is that OBJECT_SELF should be faster.  I am not sure where the macro comes into play.    macro's are more of a compile time function on how the script is coded then code that runs after then script is built.     There should be such a small differance between OBJECT_SELF and a var though to make it moot point.    
  

Modifié par Lightfoot8, 08 janvier 2012 - 11:47 .


#56
henesua

henesua
  • Members
  • 3 858 messages
As far as I can see, he did not post any results for GetWaypointByTag there. That post was about quantifying the difference between GetObject and GetNearestObject

#57
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

henesua wrote...

As far as I can see, he did not post any results for GetWaypointByTag there. That post was about quantifying the difference between GetObject and GetNearestObject



Ok, I did not understand.   The test is best done in a large server,  I currently have 5 people on the server I am running so I can not do the test right now.    I woll run a profile when I get a chance with no one on the server.  i can see no reason why thr result would be any different from GetObject though.     So i am thinking of a test between,   GetObjectByTag  and GetWayPointByTag.    Both functions just returning a unique object per the tag.  are there other functions that you would added to the profile?

#58
henesua

henesua
  • Members
  • 3 858 messages
Well to establish a control (point of comparison with what Funky did) also run GetNearestObjectByTag. That should round this out.

Congrats on the five players. I'm currently only averaging 2 players. Only had as much as five players for an hour last night.

#59
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
Ok I hae results,   Basicly I set it up to where one script called the three other scripts 1000 times.   each of the three scripts found the object 50 times and assigned the value to a var.   The module has umm I want to say about 600 areas in it.  I am not even going to guess at how many waypoints there are.

results.

Script______Runs___Time

test_profile....26........... 6609
test_gobt ......26000.....27448
test_gnobt.....26000.....48438
test_gwbt.......26000.....29288

EDIT:  one flaw I can see in my test is that I used a tag that started with an 'a'  So i am rerunning the test with a tag with a 'Zep_ Prefix.   will report back.

Modifié par Lightfoot8, 09 janvier 2012 - 04:28 .


#60
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
ok, second test with the "Zep_**" tag same results.

Script______Runs___Time
test_profile.....31.............8204
test_gobt........31000......18216
test_gnobt......31000......65103
test_gwbt.......31000.......19318


I am assuning that the GOBT is out performing GWBT because both functions are seraching the same internal list.  GWBT has a little extra overhead having to check the object type to see if it is a waypoint.
 
EdiT:  I forgot to say thanks on the congrats for the number of players,  It is a rear event to see that many though,  Normally it is just a barren world.   It is normally just old players comming around to reminisce and shoot the breeze.

Modifié par Lightfoot8, 09 janvier 2012 - 04:54 .