Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Moderated > Re: Array vs Ve...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 7 of 14 Topic 9810 of 9984
Post > Topic >>

Re: Array vs Vector performance

by Andre Poenitz <poenitz@[EMAIL PROTECTED] > Jul 23, 2008 at 07:30 PM

tni <nobody@[EMAIL PROTECTED]
> wrote:
>> There appears to be significant performance difference between the
>> array and the vector.
> 
> This is just the case for Visual C++. For GCC/MinGW, the execution time
> is exactly the same.
> 
> Part of the problem are checked iterators (MS made the poor decision to
> enable them by default; if you disable them, you have to do so in any
> library you link to as well). If they are disabled, the array version is
> still faster. Looking at the assembly code, the array version is really
> clever (twice as fast as a naive assembly version), the vector version
> is lousy. The MingW assembly looks almost like a straightforward
> assembly version I would do.

Out of curiosity: Could you show the three versions of assembly code
- or if this is deemed too much Off Topic - sent them as private mail?
I'd really like to see what halves the time over a "straightforward"
assembly.

{ As used to clarify or discuss C++ implementation issues assembly code
would 
not be off-topic. -mod }


> VC8 array : 937ms
> VC8 vector (checked iterators) : 3484ms
> VC8 vector (checked iterators disabled) : 2391ms
> MinGW 4.1 : 2031ms

Andre'

-- 
      [ See http://www.gotw.ca/resources/clcm.htm
for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
 




 14 Posts in Topic:
Array vs Vector performance
krisprad@[EMAIL PROTECTED  2008-07-21 04:28:16 
Re: Array vs Vector performance
"Martin T." <  2008-07-21 14:38:29 
Re: Array vs Vector performance
Mathias Gaunard <loufo  2008-07-21 14:40:18 
Re: Array vs Vector performance
Alberto Ganesh Barbati &l  2008-07-21 15:17:18 
Re: Array vs Vector performance
tni <nobody@[EMAIL PRO  2008-07-21 15:22:02 
Re: Array vs Vector performance
"Hakusa@[EMAIL PROTE  2008-07-22 15:58:15 
Re: Array vs Vector performance
Andre Poenitz <poenitz  2008-07-23 19:30:22 
Re: Array vs Vector performance
JoshuaMaurice@[EMAIL PROT  2008-07-23 19:40:18 
Re: Array vs Vector performance
krisprad@[EMAIL PROTECTED  2008-07-23 19:58:15 
Re: Array vs Vector performance
Francis Glassborow <fr  2008-07-24 05:15:51 
Re: Array vs Vector performance
Alberto Ganesh Barbati &l  2008-07-24 05:13:20 
Re: Array vs Vector performance
Mirco Wahab <wahab@[EM  2008-07-24 13:26:45 
Re: Array vs Vector performance
tni <nobody@[EMAIL PRO  2008-07-24 13:58:16 
Re: Array vs Vector performance
krisprad@[EMAIL PROTECTED  2008-07-24 17:21:53 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Sep 7 8:44:33 CDT 2008.