-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use of std::queue instead of std::vector for outgoing messages #8
base: master
Are you sure you want to change the base?
Conversation
I got a question for you, how much memory does |
According to https://en.cppreference.com/w/cpp/container/deque: "deques typically have large minimal memory cost; a deque holding just one element has to allocate its full internal array (e.g. 8 times the object size on 64-bit libstdc++; 16 times the object size or 4096 bytes, whichever is larger, on 64-bit libc++)". But is it a problem here? According to another study (https://www.codeproject.com/Articles/5425/An-In-Depth-Study-of-the-STL-Deque-Container) std::deque still shows better performance on push_back()'s and pop_front()'s than std::vector. |
@pdimov what do you think about this? |
|
Well don't keep me in suspense, where's the output? |
|
Yeah we should use deque/queue... thanks |
More natural for this task and more efficient when removing the first element.