Community
cancel
Showing results for 
Search instead for 
Did you mean: 
64 Views

The advantage of TBB memory allocator for serial algorithm

Jump to solution

Hi,
As can be seen in Tutorial.pdf about TBB, the TBBmemory allocator is designed for parallel programming including scalable_allocator and cache_aligned_allocator. I use TBB memory allocator by the automatic replacement method (set LD_PRELOAD environment variable). What surprises me is that it speedup my serial program by 80%. BTW, my serial program consumes about 2.6G memory.
So can anyone tell me what does TBB memory allocator do to allocat memory so effeciently, compared with the STL memory allocator? Thanks.

0 Kudos
1 Solution
Alexey_K_Intel3
Employee
64 Views

Hi,
As can be seen in Tutorial.pdf about TBB, the TBBmemory allocator is designed for parallel programming including scalable_allocator and cache_aligned_allocator. I use TBB memory allocator by the automatic replacement method (set LD_PRELOAD environment variable). What surprises me is that it speedup my serial program by 80%. BTW, my serial program consumes about 2.6G memory.
So can anyone tell me what does TBB memory allocator do to allocat memory so effeciently, compared with the STL memory allocator? Thanks.


Most likely, such a significant speedup for the serial program is not only due to faster allocation but also better cache utilization. The allocator does its best to re-allocate recently freed space with the same or "close enough" allocation size.For some applications, especially allocating lots of similar-sized small objects, it can make significant difference; but this can not be guaranteed.

View solution in original post

2 Replies
Alexey_K_Intel3
Employee
65 Views

Hi,
As can be seen in Tutorial.pdf about TBB, the TBBmemory allocator is designed for parallel programming including scalable_allocator and cache_aligned_allocator. I use TBB memory allocator by the automatic replacement method (set LD_PRELOAD environment variable). What surprises me is that it speedup my serial program by 80%. BTW, my serial program consumes about 2.6G memory.
So can anyone tell me what does TBB memory allocator do to allocat memory so effeciently, compared with the STL memory allocator? Thanks.


Most likely, such a significant speedup for the serial program is not only due to faster allocation but also better cache utilization. The allocator does its best to re-allocate recently freed space with the same or "close enough" allocation size.For some applications, especially allocating lots of similar-sized small objects, it can make significant difference; but this can not be guaranteed.

View solution in original post

64 Views

Hi,
As can be seen in Tutorial.pdf about TBB, the TBBmemory allocator is designed for parallel programming including scalable_allocator and cache_aligned_allocator. I use TBB memory allocator by the automatic replacement method (set LD_PRELOAD environment variable). What surprises me is that it speedup my serial program by 80%. BTW, my serial program consumes about 2.6G memory.
So can anyone tell me what does TBB memory allocator do to allocat memory so effeciently, compared with the STL memory allocator? Thanks.


Most likely, such a significant speedup for the serial program is not only due to faster allocation but also better cache utilization. The allocator does its best to re-allocate recently freed space with the same or "close enough" allocation size.For some applications, especially allocating lots of similar-sized small objects, it can make significant difference; but this can not be guaranteed.

Got it. Thank you very much.

Reply