loss in performance using STL's Vector, instead of linked lists?

This is a discussion on loss in performance using STL's Vector, instead of linked lists? within the Game Programming forums, part of the General Programming Boards category; I was wondering, what would the performance difference be if you used a vector to hold your constantly modified info, ...

  1. #1
    'AlHamdulillah
    Join Date
    Feb 2003
    Posts
    790

    loss in performance using STL's Vector, instead of linked lists?

    I was wondering, what would the performance difference be if you used a vector to hold your constantly modified info, e.g. firing off gun rounds in an FPS, compared with storing and traversing a linked list? Is it really THAT great , now that speed of proccessors has reached this far?

  2. #2
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    Use whatever STL container best fits your needs. If you're using a linked list now, chances are an std::list would be better than an std::vector.
    You need to understand each containers limitations (searching, insertion, traversal, deleting, etc.) and choose which one would most efficiently represent your data.

    I doubt you'll see that huge of a performance hit in using an std::list vs. your own linked list which you programmed.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Singly Linked Lists: Clarification Needed
    By jedispy in forum C++ Programming
    Replies: 4
    Last Post: 12-14-2006, 04:30 PM
  2. Linked Lists 101
    By The Brain in forum C++ Programming
    Replies: 5
    Last Post: 07-24-2004, 04:32 PM
  3. Map file formats and linked lists
    By Spitball in forum Game Programming
    Replies: 2
    Last Post: 03-04-2004, 10:32 PM
  4. need help w/ linked lists
    By MKashlev in forum C++ Programming
    Replies: 11
    Last Post: 08-05-2002, 08:57 PM
  5. doubly linked lists
    By qwertiop in forum C++ Programming
    Replies: 3
    Last Post: 10-03-2001, 06:25 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21