AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Are multi-dimentional arrays faster? (https://forums.alliedmods.net/showthread.php?t=85848)

Vet 02-16-2009 23:55

Are multi-dimentional arrays faster?
 
Is it faster to have a sinlge multi-dimentional array, or several single dimention arrays?
In other words, is this...
Code:


new data[33][3]
data[1][2] = data[1][0] + data[1][1]

faster than...
Code:


new data0[33]
new data1[33]
new data2[33]
data2[1] = data0[1] + data1[1]

I have a plugin that needs to access several values stored in an array. Since this is in the player_think routine, I'd like to make it as fast as possible to prevent the possibility of lag.

jim_yang 02-17-2009 00:51

Re: Are multi-dimentional arrays faster?
 
slower than the separate one


All times are GMT -4. The time now is 17:09.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.