Posts

Showing posts from April 12, 2019

making vector push-front improved to O(1) / 8192

Image
-2 Last question, on StackOverflow.com about speeding vector.push_back and push_front was said to have it's place here. So here it is : Well well well, looks like, after work, my regenerating reserve vector may not be so bad after all ? (in question "44326712/speeding-vector-push-back", I presented a vector with a regenerating reserve, faster at push_back when reserve cant be predicted). Deque may be cool, but faster is the vector. So I ameliorated my Vector, with two reserves : one before the begin and another after the end, thus, enabling push_front in a vector very quickly (push_back is still better than normal vector). With a RESA of 8192, and 1000 push_front, I had this results (computer is a Lenovo Think Center): duration old push_front == 199 ticks ("insert (v.begin () , s)"