performance - What is paging effect in C++? -


I came across because I was trying to learn the array and vectors in C ++. What is the "paging effect" mentioned in the post? Also, to test your understanding, I think the Vector uses more time due to dynamic memory allocation. Am i right


Additional questions: but vector & lt; Int & gt; Arr (10000) Already enough memory for 10000 int is not allocated?

Itemprop = "text">

If you pressed push_back If you use, vector uses dynamic allocation, but you can apply it to allocate prior to memory with reserved ().

Checked builds (normal in debug libraries) also check the limit of vector operations, which can slow them down in debug mode. Release build should not be slower than raw C.

Paging means taking memory on the disk when physical memory is complete. You have to be careful over time if you think the memory being paged is to run a normal technique multiple times and to reject the longest time.

Edit: You should never use raw 'C' type instead of STL (for efficiency) those who write STL are really smart and really care about performance We do. Should be used properly, should never be worse than 'C' and it is often better. This is double to use the SATL algorithm.


Comments