]> git.tuebingen.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>
Sun, 17 Mar 2024 11:34:44 +0000 (12:34 +0100)
commit443dfbeb9d743ed80dfecfc5184506f9cdd7ee0c
tree752f68d66ab20a789e8e780450b69c77ea696df7
parentb834a567b390ee4c1ee887238cdc192b41869d38
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