Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > vector::push_back performance

Thread Tools

vector::push_back performance

Andrew Koenig
Posts: n/a
"David Harmon" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Thu, 30 Sep 2004 14:03:10 GMT in comp.lang.c++, "Andrew Koenig"
> <(E-Mail Removed)> wrote,

>>If I insert the statement

>> std::cout << v.size() << std::endl;

>>in the appropriate place, it prints 1000000 and still runs in 0.03

> But perhaps the compiler is determining statically what the size of the
> vector would be at that point and encoding only that string in the
> executable. I think you have to read the initial 1000000 from a file
> that is unknown at compile time.

Possible but unlikely.

How about trying whatever tests you feel are appropriate on your own machine
and reporting the results?

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Performance Tutorials Services - Boosting Performance by DisablingUnnecessary Services on Windows XP Home Edition Software Engineer Javascript 0 06-10-2011 02:18 AM
OCZ Rally High Performance USB2 (Dual Channel) Flash Memory Silverstrand Front Page News 0 09-20-2005 03:35 AM
How to quickly improve your computer's performance @ Bona... Silverstrand Front Page News 0 08-24-2005 01:26 PM Rockdirect XTI 3.8 Performance Silverstrand Front Page News 0 08-08-2005 02:37 PM
Web Form Performance Versus Single File Performance jm ASP .Net 1 12-12-2003 11:14 PM