+ Reply to Thread
Results 1 to 3 of 3

Thread: How expensive is Inspect.Unit.Lookup?

  1. #1
    Sword of Telara DoomSprout's Avatar
    Join Date
    Apr 2011
    Posts
    876

    Default How expensive is Inspect.Unit.Lookup?

    Question for Zorba I think...

    How expensive is a call to Inspect.Unit.Lookup?

    I know that Inspect.Unit.Detail is an expensive call (as an experiment I called it 5000 times in a row once per frame, and the effect was fairly extreme ), but should calls to .Lookup be carefully managed as well?

    The reason for the question is that I was considering maintaining a mapping of UnitSpec -> UnitId to improve efficiency, but if .Lookup is already really fast, it would probably have the opposite effect, just adding another layer to go through.

    Cheers,

    DS
    Last edited by DoomSprout; 03-30-2012 at 05:57 AM. Reason: Added reason

  2. #2
    Rift Chaser NerfedWar's Avatar
    Join Date
    Dec 2010
    Posts
    377

    Default

    Was thinking exactly the same question a few days ago. Was thinking about putting together a test harness to get some stats on all the API calls under different circumstances.
    ...the internet treats censorship as damage, and routes around it...
    NerfedWar Addons and Tutorials
    * Note: tutorials are currently being ported to the new site.

  3. #3
    Plane Touched Verea's Avatar
    Join Date
    Feb 2011
    Location
    Netherlands
    Posts
    200

    Default

    It's only expensive relative to your CPU. That's why it's hard to tell.

    The easiest way to find out is to run a benchmark, simply inspect the time, do 100 (or whatever) lookup queries, and then inspect the time again, subtract starting off final time and there you go.
    Verae, level 60 Cleric @ Blightweald, Guild Master of Tea Club
    I want to fly like an eagle, to the sea.
    I want to fly like an eagle, let my spirit carry me.

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts