1. Particularly painful commands
    1. pull
    2. annotate
    3. restricted log
    4. update on a workspace with a large history/number of files
  2. Specific changes that could speed things up
  3. SQLite
  4. Automated Performance Test Suite
  5. The ideal
  6. The reality
  7. Oprofile stuff

Several key operations are still prohibitively slow in monotone.

Particularly painful commands

pull

The speed of an initial pull of the db is very painful on projects of moderate size (eg. monotone's itself.) See discussion at http://colabti.org/irclogger/irclogger_log/monotone?date=2006-01-25,Wed&sel=#l263 for various thoughts about ways to make this faster.

Also discussion at http://colabti.org/irclogger/irclogger_log/monotone?date=2006-01-31,Tue&sel=#l13 for ideas.

pull has gotten far faster in 0.26+, and again in 0.30 - but it is still too slow for very large histories

annotate

Annotate is really too slow to be used. Investigation underway in net.venge.monotone.annotate branch of storing per-file revision DAG in the database as well to avoid parsing all revision rosters out of db while doing history traversal.

annotate has gotten much faster in 0.32, and again in 0.33, and should be quite usable now. It is still slow when compared to other systems, though.

restricted log

Parsing each and every roster from the revision in question to the beginning of time really hurts. Would benefit from the same per-file-DAG in database that annotate could use.

Restricted log in backwards direction (from newer to older revisions) can already be made much faster by exploiting the roster markings. (The markings hold interesting revision ids per file, i.e. revisions where the file was born, or changed it contents, name, or attributes.) However, for this to work properly, the traversal alogorithm used by the log command has to be fixed. Currently it does not always visit nodes in topological order.

restricted log (in backwards direction) has gotten much faster in 0.32, exploiting the markings and revision heights.

update on a workspace with a large history/number of files

Updating a large tree sometimes seems to take a good amount of time on a large tree and/or workspace. Finding the branch and revision to update seems to take an inordinate amount of time.

mtn up on an ?OpenEmbedded database can take 80s or more to output "updating along branch xxx". That seems an awfully long time to figure out the branch of the current checkout. Selecting the output target and actually updating was 5-10s more. During the initial 80s my CPU was mostly waiting for IO so it seems most if not all of the 100MB DB was being read into memory.

This has been traced to a number of sources, and should have improved significantly in monotone 0.30.

Specific changes that could speed things up

SQLite

See SQLiteAnalyzeDiscussion.

Automated Performance Test Suite

Timothy Brownawell created the beginnings of such a beast. You can find it in branch net.venge.monotone, in the file contrib/monoprof.sh

The ideal

What would a perfect automated suite have?

What should it test?

What should it measure?

The reality

Obviously we aren't going to start by sitting down in an afternoon and writing the perfect performance test suite. But even something simple would be quite helpful, so long as it was extensible. Perhaps a minimal framework to set up a db with some history, and run checkouts or something against it, and measure the time they take, and report that in some way... and then start factoring out each piece of this?

contrib/monoprof.sh is a useful thing to look at, but I doubt this is really doable in shell in the long run. Particular problems that ad hoc shell solutions like this run into: * insufficient focus on setting up the environment -- honestly, monoprof is quirky enough to set up, that I (njs) never do. environment management is a part of the core problem domain for this tool * insufficient hackability/refactorability

Oprofile stuff

Oprofile's callgraph mode gives very obscure output. Here is the dark knowledge you need to interpret it: http://colabti.org/irclogger/irclogger_log/monotone?date=2006-02-28,Tue&sel=23#l36

I wrote a little script to convert oprofile callstack output to the format kcachegrind can grok. I'm not sure if I entirely trust it (I was seeing some numbers above 100%?), but anyway, here it is: http://frances.vorpus.org/~njs/op2calltree.py