This is an archive of the discontinued Mercurial Phabricator instance.

wireprotov2: define and implement "filerevisionsslice" command
AbandonedPublic

Authored by indygreg on May 11 2018, 6:35 PM.

Details

Reviewers
None
Group Reviewers
hg-reviewers
Summary

This command can be thought of as a batch version of "filerevision."
Clients specify a changeset and a pair of paths. For each path within
that range, file revision data is retrieved.

While the new wire protocol is very efficient at processing thousands
of command requests, batch commands are often intrinsically more
efficient. In this particular case, this batch command prevents the
client from having to transmit potentially hundreds of thousands or
even millions of file names and file nodes. Instead, it can encapsulate
that request in a fraction of the wire size.

On the server side, batch requests such as this command allow the
server to perform a multi-get fetch from storage. Compared to a
wire protocol command per file, this should be much easier to
optimize and be far more efficient on servers.

This command is theoretically compatible with narrow clones composed
of any set of files. We don't to employ a matcher to limit which files
are retrieved because clients can construct an arbitrary combination of
"filerevisionsslice" commands to request the relevant set. That being
said, we may want to implement a filtering mechanism on this command
someday. I'm inclined to add this as a follow-up.

On the Firefox repository, a "filerevisionsslice" request for the full
file range takes a server ~33s CPU time on my i7-6700K. That's without
any optimizations. Profiling indicates most of that time is spent in
revlog code opening revlogs and resolving fulltext data. I have
experimented with formalizing a more advanced file storage interface
that supports multi-get and hooking a Redis cache into that interface
and the results are *very* promising. But ~33s CPU time to serve
effectively a full revision checkout is a pretty good place to start!

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

indygreg created this revision.May 11 2018, 6:35 PM
indygreg abandoned this revision.Aug 21 2018, 4:23 PM