Community
cancel
Showing results for 
Search instead for 
Did you mean: 
isnork
Beginner
25 Views

Rapid question about concurrent_vector.

Jump to solution
Hi,

When declaring a concurrent_vector, i.e:
[bash]tbb::concurrent_vector v;[/bash]
if the number of elementes that the vector will contain is known beforehand, using
[bash]v.reserve( size );[/bash]
will improve the performance?

Thanks in advance.
0 Kudos

Accepted Solutions
RafSchietekat
Black Belt
25 Views
Using reserve() generally seems to be a good idea. For tbb::concurrent_vector, it would appear to improve access time as well as growth time, but I have not analysed or measured this.

View solution in original post

2 Replies
RafSchietekat
Black Belt
26 Views
Using reserve() generally seems to be a good idea. For tbb::concurrent_vector, it would appear to improve access time as well as growth time, but I have not analysed or measured this.

View solution in original post

isnork
Beginner
25 Views
Thank you Raf!