Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jun 2003
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    arrays: many or one comprehensive one?

    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?

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Posts
    623
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Break it up if your loops will be bigger using one array. Otherwise, use whatever is easier to edit.

  • #3
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    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

    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.

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    Adirondacks
    Posts
    516
    Thanks
    4
    Thanked 4 Times in 4 Posts
    break it up like an outline or family tree

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Posts
    623
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If you want to know some tricks to make 2d faster just ask
    I'll ask A1ien51, sounds interesting.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •