Is vector much slower than a normal array?

Правка en3, от 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?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский le9018468 2018-08-16 17:57:33 266 Reverted to en1
en2 Английский le9018468 2018-08-16 04:24:27 266
en1 Английский le9018468 2018-08-15 06:59:00 312 Initial revision (published)