• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Speed Comparison

Status
Not open for further replies.
Level 7
Joined
Apr 27, 2011
Messages
272
I've been checking alot of sites i know but i cannot find a speed comparison table... so i decided to post here.

So is this a correct order of speed comparison? Since Im really confused about their speed. ("<" - means slower than)

Gamecaches < Structs < Hashtables < Arrays < 2D Arrays (in vJASS)

or you can just tell me which one works the fastest among them in terms of recovering and storing of values/data .
 
structs compile to arrays imho so their speed is equal
gamecache is slowest
hashtables are second slowest and become slower with more data stored in them
2d arrays require normal arrays so they are slower than normal arrays (which should be fastest)

Speed:
1. Array
2. 2D-Array/Struct(not 100% sure)
3. hashtable
4. gamecache

it depends on how you want to store the data
if you want to attach it to handles your only way is to use hashtables or structs and some attachment stuff
if you want to store less than 8192 things with indexes less than 8192 you should use arrays
if you want to save/load data in campaigns you can use gamecaches
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,255
if only Blizzard allowed timer callback functions to take arguments....
It would make no sense from a programming point of view. How would they get stored? When would they get evaluated? How many would be supported?

The fastest is logically non array variables (scalar variables) as they are 1 memory lookup rather than 2 that an array needs.

Hashtables are prety slow compared to an array lookup due to the complexity of the underlying data structure but they provide an enormous scope range and keep an efficiency of mostly near O(1).

A gamecache is even slower as it is basically a hashtable but with string hashes and file syncronization.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,255
If arguments are evaluated when the timer is started, it would just need to store an accompany object to contain all the parameters. The timer system itself would need to store this reference but that can be done as an object variable for the timer itself.

The problem with JASS is the code argument that the timer takes does not support arguments at all. You can however make a system which stores a vJASS struct to a timer using simlar principles (although not the same).
 
Status
Not open for further replies.
Top