Literature on performance of C++ algorithms

Hey guys.
I've been on a programming competition last week, and I scored 5th place in my city, which is disappointing for me since I worked hard and REALLY wanted to be the first place and go to the national competition.

One of the main problems of my code was performance. One of the problems on the competition was to make some kind of sorting program that could handle more than 100000 inputs in less than 10s. I solved that problem, but I got only 30% of the points - probably because my program was too slow for the large inputs.

So, my question is, where can one learn how to optimize the performance of code? And how can even know that my code will work with 100000 inputs (since it would be a pain in the ass to test it in the console)? If someone could name any books that would help me, I would be very grateful.

Thanks in advance!
And how can even know that my code will work with 100000 inputs
You test it with fixed known inputs (fixtures).

where can one learn how to optimize the performance of code?
Search for Algorithm Complexity. There is a simple notation (big-O notation) that expresses which way the algorithm is going.
Topic archived. No new replies allowed.