Whamcloud - gitweb
libext2fs: further optimize rb_test_bit
authorTheodore Ts'o <tytso@mit.edu>
Sat, 6 Oct 2012 01:59:40 +0000 (21:59 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 11 Oct 2012 10:30:35 +0000 (06:30 -0400)
commitfb129bba73868a41df74fec87773abd0c6c6cd4a
tree63d46975bc678393f49ff350067636b4eb04d352
parent0bcba36f3f90488d2ef7502bd3c4f4920f2c4251
libext2fs: further optimize rb_test_bit

Profiling shows that rb_test_bit() is now calling ext2fs_rb_next() a
lot, and this function is now the hot spot when running e2freefrag.
If we cache the results of ext2fs_rb_next(), we can eliminate those
extra calls, which further speeds up both e2freefrag and e2fsck by
reducing the amount of CPU time spent in userspace.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/ext2fs/blkmap64_rb.c