Tuesday, January 02, 2007

 

Cache Considerations when Queuing

Using a FIFO(stack) is more efficient than FILO(queue), because whatever was enqueue last is most likely to be in cache when you dequeue. This works well for a free list.

I just did this and found the average performance for dequeuing from a free queue went up 3 times.

When dequeueing, it may be a good idea to pre-fetch the next buffer or two on the list. Pre-fetching still cause cycles even when the memory is already in cache, so this may or may not improve your performance depending on how much cache miss the dequeue operation is experiencing.

Comments: Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?