Thread: Various optimization questions

  1. #46
    </3 Segfaults
    Join Date
    Jul 2007
    Quote Originally Posted by anon View Post
    If you are supposed to print the primes within the 20 seconds, then the competition is slightly pointless: I/O is the main bottle-neck for which micro-optimisations such as using arrays of bools (are you sure it even has a positive impact) don't help much. All in all it comes to how fast the display scrolls which might eventually make any implementation practically equal.

    I think I suggested it before, but you'll get a more meaningful comparison if you change the rules, remove output requirement and time how long it takes to find N primes. You may only then be required to output them somehow (probably to file) to be able to see that the algorithm is correct in the first place.
    Which is exactly what happened. Everybody in the top 4 filled in at around 3 mil.

    As for the half-size array, I did that to conserve memory, not to make it run faster.

    Everybody else was way behind. (one person's program didn't even run)

    Anyways, how did you declare a group of bits?
    Last edited by Differ; 08-01-2007 at 03:59 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. many questions about random numbers....
    By face_master in forum C++ Programming
    Replies: 2
    Last Post: 07-30-2009, 08:47 AM
  2. Turn Off Optimization?
    By danlee58 in forum C Programming
    Replies: 6
    Last Post: 12-10-2008, 03:52 AM
  3. A very long list of questions... maybe to long...
    By Ravens'sWrath in forum C Programming
    Replies: 16
    Last Post: 05-16-2007, 05:36 AM
  4. Trivial questions - what to do?
    By Aerie in forum A Brief History of
    Replies: 23
    Last Post: 12-26-2004, 09:44 AM
  5. questions questions questions.....
    By mfc2themax in forum A Brief History of
    Replies: 1
    Last Post: 08-14-2001, 07:22 AM