pauliyobo / mapJSON

MIT License
0 stars 1 forks source link

Investigate if the lookup on the get_tile_obj function can be optimized #2

Open thgcode opened 5 years ago

thgcode commented 5 years ago

Currently, the get_tile_obj method uses a linear search to check if the tile is in the zone's bound ranges. However, I'm not sure, maybe it could be optimized to have a hash table lookup. It would be faster for maps with a large number of zones. See https://stackoverflow.com/questions/8462939/how-to-hash-a-range-of-numbers-to-a-single-position-in-the-hash-table .

pauliyobo commented 5 years ago

@thgcode I was actually wondering if I could have improved the speed. Thanks for the resource you sent, I'll try to investigate. Should you have any progress feel free to pull request.