DEV Community

Discussion on: Populating a pre-allocated array slower than a pushing to a regular array?

Collapse
 
mse99 profile image
Mohamed Edrah

It probably does allocate some sort of array or object behind the scene, It won't be as performant because the runtime will have to do extra work in order to get or set elements, but to answer your question, no allocation does happen one way or another the runtime will create a data structure to represent your program's data.