Thread: Vector access speed versus on-the-fly generation

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #14
    Registered User rogster001's Avatar
    Join Date
    Aug 2006
    Location
    Liverpool UK
    Posts
    1,472
    The storage requirement is too big for a fixed array.

    I compiled as release with O1 omptimization, The vector read was improved by a second or so, but still not close to the on demand version. Given the storage overhead also of a container method I think i will stick with generating on the fly. The actual project has no special requirement for the solution combinations other than to look them up, so if storing is not faster and also eats memory then there is nothing to be gained.

    I think this is partly down to the nature of the data also - The combinations are sequential and only require simple addition steps to cycle through them - Were the data required dependant on more complex calculations, then the storage option would certainly be preferrable.
    Last edited by rogster001; 06-28-2015 at 04:32 AM.
    Thought for the day:
    "Are you sure your sanity chip is fully screwed in sir?" (Kryten)
    FLTK: "The most fun you can have with your clothes on."

    Stroustrup:
    "If I had thought of it and had some marketing sense every computer and just about any gadget would have had a little 'C++ Inside' sticker on it'"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. vector<vector<int> > access element.
    By nimitzhunter in forum C++ Programming
    Replies: 0
    Last Post: 01-23-2011, 05:14 AM
  2. Speed of <queue> and <vector>
    By scwizzo in forum C++ Programming
    Replies: 7
    Last Post: 05-12-2009, 02:32 PM
  3. algorithms over vector: offsets or iterators for speed?
    By pheres in forum C++ Programming
    Replies: 2
    Last Post: 04-09-2009, 02:23 AM
  4. Speed comparison between vector and 2*2 array
    By cunnus88 in forum C++ Programming
    Replies: 5
    Last Post: 11-25-2007, 02:05 AM
  5. GCC 4.02 versus 4.2- Speed Increase?
    By DarrenSeth in forum Linux Programming
    Replies: 1
    Last Post: 07-02-2007, 01:19 PM