Thread: AutoIndex
View Single Post
Old 04-25-2009, 04:35 AM   #9
grim001
requires vJass
 
grim001's Avatar


Code Moderator
 
Join Date: Nov 2006
Posts: 1,540

Submissions (10)

grim001 is just really nice (277)grim001 is just really nice (277)

Send a message via AIM to grim001
Default

Increasing storage space would have no effect on performance except when allocating or freeing an ID. All you would have to do is add [size] next to the AutoIndex struct declaration. So it would be a great idea, except that no real map has ever, or will ever, be created that uses more than 8000 units at the same time. I'm not going to respond to any more stuff about that since it is so outlandish that it doesn't warrant discussion.

dead_or_alivex, before this I used H2I(u)-0x100000 all the time, so I think it is the next best option. But here are the downsides compared to automatic unit indexing:
1.) It is slower.
2.) It is possible to break it if handles get too high (rarely a problem in practice)
3.) It forces you to type a lot of code in every system (arrays, set/get functions, MaxHandles constant).
4.) It generates even mode code once compiled because of bigarrays.
5.) You are obligated to include a note explaining how the user should deal with the MaxHandles constant in every system.
grim001 is offline   Reply With Quote