On 8/26/06, me22 <me22.ca@gmail.com> wrote:
main has to return int; Your code isn't legal C++. Also, it seems
like you end up using memory in the vector after only reserving it,
not resizing it.
Yes, a forgotten int, my mistake.
After reserving the memory, I guess I can write the memory locations.
I think neither of the above affects the subject.
Your empty cycle time makes it obvious you're not even doing the most
rudimentary of optimizations.
My goal was to measure the time of the empty processing,
in order to estimate the time of the net calculation,
rather than to find out that for no operation I need no time.
Here's what I get in g++ (g++ (GCC)
4.1.1 (Gentoo 4.1.1)) after making
a few changes while using -O3 -DNDEBUG as arguments to the compiler
(though -DNDEBUG didn't make any signifigant difference):
Empty cycle
real 0m0.003s
user 0m0.000s
sys 0m0.000s
STL=1, SIMPLE=1, size=1000
real 0m1.357s
user 0m1.168s
sys 0m0.008s
STL=1, size=1000
real 0m1.337s
user 0m1.172s
sys 0m0.016s
STL=1, ITERATOR=1, size=1000
real 0m1.315s
user 0m1.172s
sys 0m0.012s
STL=1, AT=1, size=1000
real 0m1.357s
user 0m1.176s
sys 0m0.004s
I really don't see an issue here.
I neither, except that it looks like that in the case of AT checking the lower and upper