HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

2D arrays vs hashtable ?

08-28-2009, 06:46 PM#1
Troll-Brain
Considering theses assumptions :

- the hashtable is already initialized.
- i don't need to flush any member of it
- index 0 to 8190 are enough (i mean the size limitation of 2d arrays which depends of width and height doesn't matter, and only one variable will be used, no extra calling of function, since i only need few low index.)

What would be the fastest solution ?
I ask it, since i can't benchmark it for the moment.
08-29-2009, 04:55 AM#2
DioD
hashtables are 2x slower then arrays, there is benchmark on forum.

most custom made systems will be slower then natives.

slow gamecache is gone, hashtables maked for this.
08-29-2009, 09:37 AM#3
Troll-Brain
Quote:
Originally Posted by DioD
hashtables are 2x slower then arrays, there is benchmark on forum.

most custom made systems will be slower then natives.

slow gamecache is gone, hashtables maked for this.
But with 2d array there are some simple mathematics operations, i don't know if it would be faster or not.
08-29-2009, 10:04 AM#4
Toadcop
Quote:
But with 2d array there are some simple mathematics operations, i don't know if it would be faster or not.
2d arrays would be slightly faster. idk if one array is enough you should use them if not so hashtable.
08-29-2009, 11:00 AM#5
Silvenon
I think it doesn't matter anymore, because hashtables are much faster than gamecache, so the speed isn't so important, because you can't make vJass lag anymore, except if you make a really horrible code.
08-29-2009, 11:14 AM#6
Troll-Brain
Quote:
Originally Posted by Silvenon
I think it doesn't matter anymore, because hashtables are much faster than gamecache, so the speed isn't so important, because you can't make vJass lag anymore, except if you make a really horrible code.
I think you don't answer properly to the question.

@Toadcop : Ok, that was i thought.
08-29-2009, 11:29 AM#7
Captain Griffen
I expect 2d arrays will be slightly faster, but limited to 8191. Hashtables, therefore, for a very slight performance hit, give you a very large improvement.