View Single Post
  #36  
Old 08-13-2008, 02:56 PM
Bulle
Hill Giant
 
Join Date: Jan 2008
Posts: 102
Default

I think you can forget your worries about scanning 40 mob IDs in a list, as long as everything is already in memory : our regular CPUs do that in no time. Doing a binary search for that small a number is not worth it. From 500 IDs on OK may be... Or may be from 5000... You have to profile that to be sure.

What matters is that you read the ID list only very rarely from the database. DB queries cost. If it is all loaded in one shot at startup, then it is not a concern. Just make sure you do not issue one DB query per activity, as it would be a killer. For example, issue one query to load all activities at once, then one query to load all dependent mob IDs at once, then do any activity-dispatching (list creation and populating) in-memory. If you add proper "ORDER BY" sections to your queries you can even scan your activity list and your mob ID list in parallel, making it a very efficient process.
Reply With Quote