Is vector much slower than a normal array?

Revision en3, by le9018468, 2018-08-16 17:57:33

Dear all,

I tried to write a program that called a function that used a temporary vector of size 10 10^6 times. This program ran for around 1 ~ 2 seconds. However, when I switched the vector to a bool array, it ran in 0.18 seconds. Why is there such a big difference?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English le9018468 2018-08-16 17:57:33 266 Reverted to en1
en2 English le9018468 2018-08-16 04:24:27 266
en1 English le9018468 2018-08-15 06:59:00 312 Initial revision (published)