About config and useless IOs

vila vila+bzr at canonical.com
Tue Aug 23 09:40:37 UTC 2011


One of the goals of the new config stuff I'm working on is to avoid
needlessly reading config files.

This matters more when accessing remote branches than when dealing with
local configs but it's hard to realize what is going on without some
numbers.

In revno 5981, I landed some utility stuff to measure such IOs (among
other config operations) across the whole test suite which gave the
following numbers (when running the test suite with -Econfig_stats and
then invoking subunit-sum on the resulting stream, see
https://code.launchpad.net/~vila/bzr/selftest-config-stats/+merge/64549
for details):

config.load      : 296
config.save      : 106
config.get       : 82
config.set       : 52
config.remove    : 8
old_config.load  : 1002308
old_config.save  : 5018
old_config.get   : 383768
old_config.set   : 4873
old_config.remove: 14

Each line represents the number of times a hook is called and a hook is
set for every config operation (loading/saving a file,
getting/setting/removing a config option).

This gives some rough idea of the starting point.

What happened since then ?

revno 5999: (spiv) Make Branch.open more than 3x faster. 

config.load      : 297
config.save      : 106
config.get       : 83
config.set       : 52
config.remove    : 8
old_config.load  : 896574
old_config.save  : 5022
old_config.get   : 384308
old_config.set   : 4877
old_config.remove: 14

Boom, 200.000 useless IOs down the drain.

revno 6047: (mbp) merge 2.3 and 2.4 to trunk 

config.load      : 603
config.save      : 106
config.get       : 190444
config.set       : 52
config.remove    : 8
old_config.load  : 806023
old_config.save  : 5053
old_config.get   : 334777
old_config.set   : 4904
old_config.remove: 14

What is really relevant in this merge is the introduction of the
fdatasync options which use the new design: ~189.000 useless IOs down
the drain again (notice that that config.load is now less than
config.get because Martin did cache the config in the workingtree/branch
object and avoided re-loading the config file for each option).

revno 6082 (the tip when I ran all these stat collection jobs):

config.load      : 62055
config.save      : 114
config.get       : 258910
config.set       : 58
config.remove    : 8
old_config.load  : 631616
old_config.save  : 5070
old_config.get   : 271380
old_config.set   : 4923
old_config.remove: 14

Here we see that 60.000 IOs went from the old design to the new one (due
to migrating the options from one design to the other) which is a
pre-requisite to avoid most of them when reaching the read once/write
once I'm aiming with the new design.

   Vincent




More information about the bazaar mailing list