The shell script and the configuration file in this directory can be used to benchmark the NeoMutt hcache backends.
In order to run the benchmark, you must have a directory in maildir format at hand. NeoMutt will load messages from there and populate the header cache with them. Please note that you'll need a reasonable large number of messages - over 50,000 - to see anything interesting.
The script accepts the following arguments
-e Path to the neomutt executable
-m Path to the maildir directory
-t Number of times to repeat the test
-b List of backends to test
Example: ./neomutt-hcache-bench.sh -e /usr/local/bin/neomutt -m ../maildir -t 10 -b "lmdb gdbm rocksdb tdb"
The benchmark works by instructing NeoMutt to use the backends specified with
-b one by one and to load the messages from the maildir specified with -m.
NeoMutt is launched twice with the same configuration. The first time, no header
cache storage exists, so NeoMutt populates it. The second time, the previously
populated header cache storage is used to reload the headers. The times taken to
execute these two operations are kept track of independently.
At the end, a summary with the average times is provided.
$ sh neomutt-hcache-bench.sh -m ~/maildir -e ../../neomutt -t 10 -b "lmdb gdbm rocksdb tdb"
Running in /tmp/tmp.TFHQ8iPy
1 - populating - lmdb
1 - reloading - lmdb
1 - populating - gdbm
1 - reloading - gdbm
1 - populating - rocksdb
1 - reloading - rocksdb
1 - populating - tdb
1 - reloading - tdb
2 - populating - lmdb
2 - reloading - lmdb
....
10 - populating - rocksdb
10 - reloading - rocksdb
10 - populating - tdb
10 - reloading - tdb
*** populate
lmdb 2.904 real 1.922 user .697 sys
tdb 3.288 real 1.922 user .837 sys
gdbm 3.036 real 1.959 user .960 sys
rocksdb 2.830 real 2.132 user .625 sys
*** reload
lmdb .845 real .612 user .207 sys
tdb .802 real .587 user .195 sys
gdbm .805 real .600 user .183 sys
rocksdb 1.002 real .759 user .224 sys
## Notes
The benchmark uses a temporary directory for the log files and the header cache
storage files. These are left available for inspection. This also means that
*you* must take care of removing the temporary directory once you are done.
The path to the temporary directory is printed on standard output when the
benchmark starts, e.g., `Running in /tmp/tmp.TFHQ8iPy`