Found out last night that the vc-*-dir-state is called for every directory in the tree and is expected to return the status for only the files in that dir, not for the subdirs.
So I changed the update command to add these flags.
- -n | --nochange : do not change any files, but go through the motions.
- --local : do not autosync even if autosync is on in the settings
- -v : verbose, print messages even for UNCHANGED and EDITED
- --file name : only print status for file name. If name is a directory, print status for files in that directory, but not for subdirectories.
Now C-x v d on the fossil tree takes a few seconds. There's more speedup that can be done in update.c to filter out the subset earlier in the function if the --file flag is specified.