- Joined
- Jul 10, 2007
- Messages
- 6,306
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
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)) *
* | | *
*-----------------------------------------------------------------------------------------------*