I am developing a massive multiplayer online 2D game in Haxe/OpenFL, where world is divided into two-dimensional grid of sectors, therefore each sector acts as one object. On server, these sector objects may or may not exist in memory (depending on whether players are currently in them or not) and I need to access these sector objects via their x and y coordinate. Theoretically there can be several thousands of these objects at any given time.
My question is, what is the best (fastest, most efficient) way of storing and accessing these objects. I tried to use two-dimensional arrays with x and y as indexes, but my implementation was extremely slow.