Raised This Month: $ Target: $400
 0% 

Are multi-dimentional arrays faster?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Vet
Veteran Member
Join Date: Jul 2006
Location: I|O wa
Old 02-16-2009 , 23:55   Are multi-dimentional arrays faster?
Reply With Quote #1

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.
__________________
=====================================
- My Plugins -
=====================================
Vet is offline
Send a message via MSN to Vet
jim_yang
Veteran Member
Join Date: Aug 2006
Old 02-17-2009 , 00:51   Re: Are multi-dimentional arrays faster?
Reply With Quote #2

slower than the separate one
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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