1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

AU reloads list file from disk on every run.

Discussion in 'Program Help' started by nog_lorp, Jan 20, 2013.

  1. nog_lorp

    nog_lorp Newbie

    Joined:
    Jan 18, 2013
    Messages:
    32
    Likes Received:
    1
    This seems like a massive unnecessary delay! It ought to only reload the file if it has been modified.
     
  2. expon

    expon Administrator
    Staff Member

    Joined:
    Oct 30, 2006
    Messages:
    1,393
    Likes Received:
    56
    Location:
    UK
    true it's not the best way but I wouldn't call it a massive delay... timing the disk accesses on my computer they typically take 0.001-0.003s ranging up to 0.01s in the worst case - I really don't think it's going to affect the success rate :p but it's a good point. I'll change it in the next version :)
     
  3. Junior

    Junior Administrator
    Staff Member

    Joined:
    Nov 8, 2009
    Messages:
    3,350
    Likes Received:
    169
    Location:
    I come from a land down under! (Maaaate!)
    The fact you somehow got Expons attention and he posted.. You sir, are a winner in my books!

    Hi Expon!
     
  4. nog_lorp

    nog_lorp Newbie

    Joined:
    Jan 18, 2013
    Messages:
    32
    Likes Received:
    1
    :)

    Another thing, what is the deal with the post-restock pause? Is it still buying during this time? Must be so or I can't imagine it would ever get any buys.

    I was also going to suggest using a hash table for the list instead of iterating an array, since the complexity is (list size)*(stock size). Then I figured out it takes 1mil+ string comparisons before breaching 1ms on my trash laptop.
     
  5. expon

    expon Administrator
    Staff Member

    Joined:
    Oct 30, 2006
    Messages:
    1,393
    Likes Received:
    56
    Location:
    UK
    Hi Junior :) what! I have posted at least 10 times in the last month :p

    the after restock pause happens only once there are no items on your list left in stock, some other tasks like auto pricing take place during this pause
     
  6. Lightning

    Lightning Administrator
    Staff Member

    Joined:
    Nov 8, 2008
    Messages:
    3,021
    Likes Received:
    195
    Gender:
    Male
    Location:
    Florida, USA
    There would be no point in using a HashTable (called a Dictionary in the .NET Framework). The performance of iterating through an array is actually better than that of a HashTable/Dictionary because it contains a key, value pair. In addition, there would be no need in having a key, value pair. It's just a waste of memory.

    However, using a HashSet may improve performance of the program in the microseconds because of its fast read (and write) access times. The benefits would minimal.


    The most noticeable improvements would be made to the wrapper - perhaps including pipelining into the wrapper?
     
  7. nog_lorp

    nog_lorp Newbie

    Joined:
    Jan 18, 2013
    Messages:
    32
    Likes Received:
    1
    Ah, a HashSet. I snooped around for such a thing, I'm not familiar with .NET though.

    There is really no reason to iterate through the HashTable! You just check if your key is in the table. You can ignore the value (apparently it can be null), in which case I think it is basically the same as a HashSet.

    You're right though, it's a massive concession of space in order to increase speed, in this case by undetectable amounts, so clearly it doesn't make sense. Maybe if your item list includes a significant portion of all possible items :)

    Edit: Thanks for the clarification about the restock pause.