View Single Post
Old 03-07-2005, 09:12 PM   #18
eiz
New Member
 
Join Date: Feb 2005
Posts: 25
eiz is on a distinguished road
Well, in Aetas, since there is no fixed time interval, we could be getting numerous events that are ready to fire, but were queued to fire at different times. So if we find out that events at times 6, 4, and 1 are ready to fire, we need to order these properly. I don't know how MudCore works, but I'll take your word that a list matches how your system is set up.

As for modifying events, we handle this in a more declarative fashion: instead of modifying the event queue itself, the event knows how to detect changed conditions. For example, an event applied to a player will have a weak reference to this player so that it knows if they have been disconnected.

So I would say to choose the data structure that best fits your event model. For us, that is a priority queue. Your mileage may vary =)

edit (boy, I'm doing a lot of these tonight): I think your benchmark demonstrates that all of the data structures have pretty good performance here, and the difference will probably only be noticeable on your 'ps' output. Better to worry about optimizing the amount of time you spend waiting for IO. (fire and brimstone, stupid censorship), most muds get away with iterating through the entire game dataset non-stop, I don't know why we're even discussing it...
eiz is offline   Reply With Quote