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

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User rogster001's Avatar
    Join Date
    Aug 2006
    Location
    Liverpool UK
    Posts
    1,472
    Good question, but I can't answer it because you didn't post your code
    Fair comment Jimblumberg - I was a little irritated by my results as much as anything earlier, sorry! there is no sorting involved, or required even - And maybe that is the point - If can sequentially generate all combos to test my solutions,- and exit the check as soon as required - then that is always going to be faster that storing all the combinations and then test them later?
    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'"

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by rogster001 View Post
    ...If can sequentially generate all combos to test my solutions,- and exit the check as soon as required - then that is always going to be faster that storing all the combinations and then test them later?
    Well, I mean, if you're generating, storing, testing vs generating, testing, the later is obviously going to be faster.
    Are you serializing these tests or something? Otherwise it would seem better to me to just generate and immediately tested. Saves memory and calculation time.
    Last edited by Elysia; 06-27-2015 at 01:43 PM.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

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