• 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.

Some quick benches

Status
Not open for further replies.
These benches were conducted to look at the viability of pointers.

Pointers are ok to use so long as they are inlined, meaning that a language must be written on top of Galaxy for support as working with the arrays directly is very prone to error. Furthermore, pointers require bitwise operations to retrieve the information. Each bitwise operation adds ~.05 ms/1000 executions.

Isn't even 2.67 ms per thousand executions fast enough? Not really, a pointer scheme should add minimum overhead to code so that performance intensive operations will run without any hiccups as a result of using these pointers.

Tested on the following computer:

Windows 7 Ultimate 64-bit (6.1, Build 7601)
Intel(R) Core(TM) i7-3930K CPU @ 4.29 GHz
16384 MB RAM
Asus DCII AMD Radeon 6970

Code:
*-----------------------------------------------------------------------------------------------*
*												*
*					Quick Benches						*
*					-------------						*
*												*
*	All tests ran set followed by get							*
*												*
*		DataTableSetInt									*
*		DataTableGetInt									*
*												*
*		arr[arr[3]] = 3									*
*		var = arr[arr[3]]								*
*												*
*		arr[3] = 3									*
*		var = arr[3]									*
*												*
*		scalar = 3									*
*		var = scalar									*
*												*
*		setArr(3, 5)									*
*		var = getArr(3)									*
*												*
*		setSc(5)									*
*		var = getSc(5)									*
*												*
*												*
*-----------------------------------------------------------------------------------------------*
*			|				    |					*
*	 Test           |       Time (ms/1000 calls)        |	         Description		*
*			|				    |					*
*-----------------------------------------------------------------------------------------------*
*			|				    |					*
*	Data Table G:	|             2.670 	            |	Global				*
*	Data Table L:	|             2.750 	    	    |	Local				*
*	Array 2:	|             0.970 	    	    |	(arr[arr[3]])			*
*	Array:		|             0.671         	    |	(arr[3])			*
*	Scalar:		|  	      0.403 	    	    |					*
*	Array Func:	|             2.000    		    |	(setArr(index, value))		*
*	Scalar Func:	|             1.900  		    |	(setSc(value))			*
*			|				    |					*
*-----------------------------------------------------------------------------------------------*
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
The conclusion of this is that you should avoid dynamic programming concepts where possible in favour of static programming concepts.

For abilities try and let the data editor do the persistence, only use triggers for key steps that are hard to produce using data (formula damage or random locations).
 
Status
Not open for further replies.
Top