]> git.tue.mpg.de Git - paraslash.git/commit
btr: Speed up btr_node_status().
authorAndre Noll <maan@tuebingen.mpg.de>
Fri, 30 Dec 2022 13:09:06 +0000 (14:09 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Wed, 8 May 2024 17:45:52 +0000 (19:45 +0200)
commitdb654ceb7ced70cdd133c547196b3de4207e3112
tree2f218b0e7dfb915ebb1e6f7e2e4c113d19e91147
parent76f5f13b1216c4579eae6c9e1d142a6c929ee196
btr: Speed up btr_node_status().

Currently we sum up the sizes of all buffers in the input queue just to
determine if the total size exceeds a small threshold. That's silly
and expensive if there are many buffers. Fix that by introducing
a helper which breaks out of the loop as soon as know the answer
because the threshold is exceeded.

User time: 150s -> 147s, speedup: 2%
buffer_tree.c