Ring library optimization idea

Morten Brørup mb at smartsharesystems.com
Sun Aug 20 11:23:38 CEST 2023


Most of the fast path ring library functions access the two cache lines containing respectively the r->prod and r->cons structures.

Some of the fast path functions also have to fetch r->capacity and r->mask, which reside in another cache line.

What do you think about adding shadow variables of r->capacity and r->mask to the same cache line as r->prod, to improve ring library performance (by avoiding having to read a third cache line) when under CPU cache pressure?

-Morten



More information about the dev mailing list