There shouldn't be a performance difference
between vector and a dynamic array, since a vector
*is* a dynamic array.

The performance difference in your code comes
from the fact that you are actually doing
different things between the vector and array
version. For instance:

```
std::vector<int>
primes(primes_count, 0);
for (auto i = 0; i < max_prime; i++) {
if (is_prime[i]) {
primes.push_back(i);
}
}
return primes;
```

This creates a vector of size
`primes_count`

, all initialized to 0,
and *then* pushes back a bunch of primes
onto it. But it still starts with
`primes_count`

0s! So that's wasted
memory from both an initialization perspective and
an iteration perspective. What you want to do
is:

```
std::vector<int> primes;
primes.reserve(primes_count);
// same push_back loop
return primes;
```

Along the same lines, this block;

```
std::vector<int>
is_prime(max_prime, true);
is_prime[0] = is_prime[1] = false;
for (auto i = 2; i < max_prime; i++) {
is_prime[i] = true;
}
```

You construct a vector of
`max_prime`

ints initialized to true...
and then assign most of them to true again. You're
doing the initialization twice here, whereas in
the array implementation you only do it once. You
should just remove this for loop.

I bet if you fix these two issues - which would
make the two algorithms comparable - you'd get the
same performance.