Author Topic: Speed Comparison EUO Finditem VS OEUO Finditem  (Read 5960 times)

0 Members and 1 Guest are viewing this topic.

Offline manwincTopic starter

  • Elite
  • *
  • *
  • Posts: 2556
  • Activity:
    0%
  • Reputation Power: 32
  • manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!
  • Gender: Male
  • "The Devs Hard at Work"
  • Respect: +123
  • Referrals: 1
    • View Profile
Speed Comparison EUO Finditem VS OEUO Finditem
« on: September 19, 2010, 08:06:24 PM »
0
The Biggest thing that would make me switch between EUO and OEUO is the difference in the latency in its ability to locate items.

I have some experience in the coding for OEUO, But am not using it on a regular basis, so was wondering if someone could do a test for me.

Compare the time required in ms for finding and getting the property of all items within your backpack, report the time required to complete the code, and the number of items in your backpack.

I would be greatly appreciative.
Monkeys and Typewriters!

" Oh I know, We'll make a Boss Encounter that requires 3 keys per player to enter, Then we'll make it not a closed instance so you never know if you are going to pop into a fresh room or a boss that has 1% Health left with 20 dudes smashing its face in, wasting your time and effort"

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Speed Comparison EUO Finditem VS OEUO Finditem
« Reply #1 on: September 19, 2010, 08:19:34 PM »
0
It's pretty easy with my finditem subs I wrote for OEUO.  It's all built-in.....  You might try and give it a shot.  Look at this thread:

http://www.scriptuo.com/index.php?topic=5960.0

property is automatically collected for each item found.

I'm in the middle of doing some coding for the file subs, but what you ask is pretty easy to do with those subs.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Speed Comparison EUO Finditem VS OEUO Finditem
« Reply #2 on: September 19, 2010, 09:28:39 PM »
0
And just for the lazy, here's the test:

(btw, as I figured, there isn't much speed difference)

EUO code:

Code: [Select]
set #LPC 10000
set %time #SCNT2
finditem * C_ , #BACKPACKID
for #FINDINDEX 1 #FINDCNT
  event property #FINDID
set %time #SCNT2 - %time
display ok %time
stop

Time = 1.8 seconds for 33 items (#LPC has no effect)

OEUO code:

Code: [Select]
dofile("tm_subs_collection6.lua")
time = getticks()
count, stack, items = TM_FindItem("*","c", {UO.BackpackID}, 1)
print(getticks() - time)

Time = 1.65 seconds (same container)

Speeds bounce around so much between both EUO and OEUO that I'd say these are pretty much the same on average.  Sorry, no speed help for you with OEUO.  There's a 1000 other reasons why you SHOULD use it.  Finditem isn't one of them.... ;)
« Last Edit: September 19, 2010, 09:39:51 PM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Scrripty

  • Guest
Re: Speed Comparison EUO Finditem VS OEUO Finditem
« Reply #3 on: September 20, 2010, 12:53:20 AM »
0
But you can iterate through the found items so fast, you could probly use the same info for one or two extra finds... depending on what you're doing, and if you've moved or not... search distance... all that.

Offline manwincTopic starter

  • Elite
  • *
  • *
  • Posts: 2556
  • Activity:
    0%
  • Reputation Power: 32
  • manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!
  • Gender: Male
  • "The Devs Hard at Work"
  • Respect: +123
  • Referrals: 1
    • View Profile
Re: Speed Comparison EUO Finditem VS OEUO Finditem
« Reply #4 on: September 20, 2010, 07:11:57 AM »
0
Yeah, I know that its Sheer Computational Abilities are extremely faster than that of euo, but I was curious if the interaction between the client and it is any better. I think I'll start working on a new version of my suit builder in OEUO since it can just crunch the numbers sooo much faster.
Monkeys and Typewriters!

" Oh I know, We'll make a Boss Encounter that requires 3 keys per player to enter, Then we'll make it not a closed instance so you never know if you are going to pop into a fresh room or a boss that has 1% Health left with 20 dudes smashing its face in, wasting your time and effort"

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: Speed Comparison EUO Finditem VS OEUO Finditem
« Reply #5 on: September 20, 2010, 07:50:50 AM »
0
interesting.. but are you sure that euo is actually finiding all the properties... event property doesnt always return the actual property in my experience if you go to fast.
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Speed Comparison EUO Finditem VS OEUO Finditem
« Reply #6 on: September 20, 2010, 07:56:52 AM »
0
In this case it was working fine.  I wasn't moving around, and that's when event property really falls flat when your character is moving.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Speed Comparison EUO Finditem VS OEUO Finditem
« Reply #7 on: September 20, 2010, 08:12:58 AM »
0
Here's some code that shows that everything is as it should be (44 items this time; I was doing some fishing)

REMEMBER!  If you want to test this, you need my "tm_subs_collection6.lua" collection, and this sample code must be saved with a filename.

Code: [Select]
dofile("tm_subs_collection6.lua")
time = getticks()
count, stack, items = TM_FindItem("*","c", {UO.BackpackID}, 1)
endtime = getticks() - time
print(string.format("Item count = %d",count))
for i,k in ipairs(items) do
  print(string.format("%d: %s",i,k.name.."$"..k.property))
end
print(string.format("time: %f",endtime/1000))

And the results:

Code: [Select]
Item count = 44
1: Runebook$Blessed
Weight: 1 Stone
Zippy
2: Spellbook$Blessed
64 Spells
3: Necromancer Spellbook$Blessed
17 Spells
4: A Promotional Token$Blessed
Weight: 5 Stones
Use This To RedeemYour Advanced Character
5: A Message In A Bottle$Weight: 1 Stone
6: A Message In A Bottle$Weight: 1 Stone
7: A Message In A Bottle$Weight: 1 Stone
8: A Message In A Bottle$Weight: 1 Stone
9: A Message In A Bottle$Weight: 1 Stone
10: A Message In A Bottle$Weight: 1 Stone
11: A Message In A Bottle$Weight: 1 Stone
12: A Message In A Bottle$Weight: 1 Stone
13: A Message In A Bottle$Weight: 1 Stone
14: A Message In A Bottle$Weight: 1 Stone
15: A Message In A Bottle$Weight: 1 Stone
16: A Message In A Bottle$Weight: 1 Stone
17: A Message In A Bottle$Weight: 1 Stone
18: A Message In A Bottle$Weight: 1 Stone
19: A Message In A Bottle$Weight: 1 Stone
20: Dagger$Weight: 1 Stone
Physical Damage 100%
Weapon Damage 10 - 11
Weapon Speed 2s
Strength Requirement 10
One-Handed Weapon
Skill Required: Fencing
Durability 35 / 35
21: Scissors$Weight: 1 Stone
22: A Message In A Bottle$Weight: 1 Stone
23: A Message In A Bottle$Weight: 1 Stone
24: A Message In A Bottle$Weight: 1 Stone
25: A Message In A Bottle$Weight: 1 Stone
26: Cleaver$Insured
Weight: 2 Stones
Poison Resist 5%
Faster Casting 1
Hit Lightning 48%
Hit Lower Defense 18%
Lower Requirements 50%
Physical Damage 90%
Poison Damage 10%
Weapon Damage 11 - 13
Weapon Speed 2.5s
Strength Requirement 5
One-Handed Weapon
Skill Required: Swordsmanship
Durability 33 / 33
27: A Waterstained SOS$Weight: 1 Stone
28: A Waterstained SOS$Weight: 1 Stone
29: A Waterstained SOS$Weight: 1 Stone
30: A Waterstained SOS$Weight: 1 Stone
31: A Waterstained SOS$Weight: 1 Stone
32: A Waterstained SOS$Weight: 1 Stone
33: Backpack$Weight: 44 Stones
Contents: 1/125 Items, 41/400 Stones
34: A Ship Key$Insured
Weight: 1 Stone
35: An Ancient SOS$Weight: 1 Stone
36: A Waterstained SOS$Weight: 1 Stone
37: A Waterstained SOS$Weight: 1 Stone
38: A Waterstained SOS$Weight: 1 Stone
39: Recall Rune$Weight: 1 Stone
40: Recall Rune$Weight: 1 Stone
41: A Waterstained SOS$Weight: 1 Stone
42: A Waterstained SOS$Weight: 1 Stone
43: A Waterstained SOS$Weight: 1 Stone
44: A Waterstained SOS$Weight: 1 Stone
time: 2.665000
« Last Edit: September 21, 2010, 11:41:45 AM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline manwincTopic starter

  • Elite
  • *
  • *
  • Posts: 2556
  • Activity:
    0%
  • Reputation Power: 32
  • manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!
  • Gender: Male
  • "The Devs Hard at Work"
  • Respect: +123
  • Referrals: 1
    • View Profile
Re: Speed Comparison EUO Finditem VS OEUO Finditem
« Reply #8 on: September 22, 2010, 10:17:41 AM »
0
So, when you use a dofile("Name of file")

That basically allows you to use all the functions within that file yes?

Hmm..... I'm starting to really like OEUO, although I still think it will be a while before I can fully use it.
Monkeys and Typewriters!

" Oh I know, We'll make a Boss Encounter that requires 3 keys per player to enter, Then we'll make it not a closed instance so you never know if you are going to pop into a fresh room or a boss that has 1% Health left with 20 dudes smashing its face in, wasting your time and effort"

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Speed Comparison EUO Finditem VS OEUO Finditem
« Reply #9 on: September 22, 2010, 10:34:10 AM »
0
Really "require("filename")" is better suited for this.  I'll probably shift everything.  Require is nice because if the file is already loaded, it won't load it again.  I was using dofile because I wanted some active feedback to let the scripter know if an OLDER version of a file was loaded, but there might be a dependency on a newer file.

You just need to pick a small project and try OEUO out on it.  For me it was easy; I have lots of tools I use to script so I started porting all those things that make scripting easy for me.  I haven't written code for file saving, journal handling, list management, etc for a long time.  I just rely on my canned subs for that.  Once those are in place, then the scripts become easy, even in OEUO.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Speed Comparison EUO Finditem VS OEUO Finditem
« Reply #10 on: September 22, 2010, 11:39:13 AM »
0
BTW, my UI subs are really making the transition easier.  Take a typical EUO function:

Code: [Select]
sub ReleaseActivePane
  namespace push
  namespace local ACTIVE
  set !pane %1
 
  if !pane = LEFT
  {
    menu delete EUOLabelLeftTitle
    menu delete EUOButtonLeftActive
    menu Font Name Arial
    menu Font Size 7
    menu Font BGColor BtnFace
    menu Button EUOButtonLeftActive 52 32 43 17 Active
    menu delete EUOButtonDelete
    menu delete EUOButtonClear
  }
  if !pane = RIGHT
  {
    menu delete EUOLabelRightTitle
    menu delete EUOButtonRightActive
    menu Font Name Arial
    menu Font Size 7
    menu Font BGColor BtnFace
    menu Button EUOButtonRightActive 328 32 43 17 Active
    menu delete EUOButtonActiveDelete
    menu delete EUOButtonActiveClear
  }
  menu Font Size %pane_font_size
  namespace pop
return

Turns into:

Code: [Select]
---------------------------------------------------------------
function ReleaseActivePane(pane)
  if pane == "LEFT" then
    mm:TM_DeleteControl("EUOLabelLeftTitle")
    mm:TM_DeleteControl("EUOButtonLeftActive")
    mm:TM_MenuFunction("menu Font Name Arial")
    mm:TM_MenuFunction("menu Font Size 7")
    mm:TM_MenuFunction("menu Font BGColor BtnFace")
    mm:TM_MenuFunction("menu Button EUOButtonLeftActive 52 32 43 17 Active")
    mm:TM_DeleteControl("EUOButtonDelete")
    mm:TM_DeleteControl("EUOButtonClear") 
  end
  if pane == "RIGHT" then
    mm:TM_DeleteControl("EUOLabelRightTitle")
    mm:TM_DeleteControl("EUOButtonRightActive")
    mm:TM_MenuFunction("menu Font Name Arial")
    mm:TM_MenuFunction("menu Font Size 7")
    mm:TM_MenuFunction("menu Font BGColor BtnFace")
    mm:TM_MenuFunction("menu Button EUOButtonRightActive 328 32 43 17 Active")
    mm:TM_DeleteControl("EUOButtonActiveDelete")
    mm:TM_DeleteControl("EUOButtonActiveClear") 
  end
  mm:TM_MenuFunction(string.format("menu Font Size %d",pane_font_size))
end

So not much code thrashing occurs to make code work.  I already have buttons switching menu elements; the built-in button handler is a rousing success, IMHO.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Masscre

  • Gran Master Jester !!
  • Scripthack
  • *
  • Posts: 4615
  • Activity:
    0%
  • Reputation Power: 55
  • Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!
  • Gender: Male
  • Air Guitar Commander !!
  • Respect: +144
  • Referrals: 1
    • View Profile
Re: Speed Comparison EUO Finditem VS OEUO Finditem
« Reply #11 on: September 22, 2010, 06:07:50 PM »
0
So, when you use a dofile("Name of file")

That basically allows you to use all the functions within that file yes?

Hmm..... I'm starting to really like OEUO, although I still think it will be a while before I can fully use it.
I am working on trying to covert my lumberjacker to work under OEUO and then take it apart to see what is what under the new LUA structure.

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Speed Comparison EUO Finditem VS OEUO Finditem
« Reply #12 on: September 22, 2010, 06:20:26 PM »
0
Cheffe fixed the tm tiles, so lumberjacker should work nicely
Please read the ScriptUO site RULES
Come play RIFT with me!

Tags: