This change also adds a test case for subrepos.
Repeating the benchmark information from the hg-core commit:
On the Netbeans repository:
C: 840ms
Rust+C: 556ms
Mozilla Central with the one pattern that causes a fallback removed:
C: 2.315s
Rust+C: 1.700s