This two patches together lower the preparation time for replying a slowlog in accurate mode by about 5x (e.g. one test I did from 1min to 10secs). Most of the speedup comes from caching the thread id.
But this adds 8 bytes of additional memory overhead to every query entry - this is why I created the second commit which lowers it by 16 bytes per query so both commits together will lower it by 8 (=32 bytes overhead per query from now on).
This two patches together lower the preparation time for replying a slowlog in accurate mode by about 5x (e.g. one test I did from 1min to 10secs). Most of the speedup comes from caching the thread id. But this adds 8 bytes of additional memory overhead to every query entry - this is why I created the second commit which lowers it by 16 bytes per query so both commits together will lower it by 8 (=32 bytes overhead per query from now on).