...

View Full Version : arrays: many or one comprehensive one?



jvhfish
07-04-2003, 01:15 AM
i have a function intenise program that uses lots of data..
the data is fairly related, but since i have a lot of loops and comparisons happening is it bad to have "one giant array"
then smaller dedicated ones?

Graeme Hackston
07-04-2003, 05:29 AM
Break it up if your loops will be bigger using one array. Otherwise, use whatever is easier to edit.

A1ien51
07-04-2003, 09:30 AM
smaller arrays usually means faster esp. if you can get rid of for loops.

I know this from my game programming.
example would be Block Gang (http://www10.brinkster.com/a1ien51/BlockGang/)

It was slow by using 2D arrays in some parts. I cut it down to 1D in some areas and it went faster. I worked with Joh6nn to optimize the array speed.

If you want to know some tricks to make 2d faster just ask.

FJbrian
07-05-2003, 07:27 AM
break it up like an outline or family tree

Graeme Hackston
07-05-2003, 03:58 PM
If you want to know some tricks to make 2d faster just ask

I'll ask A1ien51, sounds interesting.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum