franz1981 commented on a change in pull request #525: DISPATCH-1372 alloc_pool intrusive linked list can be replaced by a linked stack URL: https://github.com/apache/qpid-dispatch/pull/525#discussion_r298285848
########## File path: src/alloc_pool.c ########## @@ -44,20 +46,142 @@ DEQ_DECLARE(qd_alloc_type_t, qd_alloc_type_list_t); #define PATTERN_BACK 0xbabecafe struct qd_alloc_item_t { - DEQ_LINKS(qd_alloc_item_t); uint32_t sequence; #ifdef QD_MEMORY_DEBUG qd_alloc_type_desc_t *desc; uint32_t header; #endif }; -DEQ_DECLARE(qd_alloc_item_t, qd_alloc_item_list_t); +//128 has been chosen because many CPUs arch use an +//adiacent line prefetching optimization that load +//2*cache line bytes in batch +#define CHUNK_SIZE 128/sizeof(void*) +struct qd_alloc_chunk_t { Review comment: That's correct, the thing is that ideally I should have used next/prev to reach the 128 bytes (ie 128 bytes should be the size of the chunk struct), but I have chosen to order the fields according to the LIFO access pattern (prev is accessed only If the first item was the last accessed) and left the adjacent line prefetcher do the dirty work for the other items not accessed yet. My bet was that the regular access pattern would make the cache prefetching do its work to fetch what has been left outside by the adjacent line prefetcher. We could try to do that: now is the better time to attempt to make it faster. Feel free to modify and ask @mgoulish to test it so if the perf will increase I will merge it here :+1: ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org