These benchmarks compare the native Python re module (“simple” backend) with the optional backends. They were run against the CPython source main branch from 2025-12-27 (commit 00e24b80e092e7d36dc189fd260b2a4e730a6e7f), configured and compiled. PathSpec and GitIgnoreSpec are tested using preloaded .gitignore patterns and file paths. File-system speed is not tested.

CPython 3.13.11 on Intel(R) Xeon(R) CPU E5-2690 0 @ 2.90GHz

GitIgnoreSpec.match_files(): 6.5k files

Patternssimple
ops
hyperscan
ops

x
re2
ops

x
1163.491.40.5687.20.53
564.474.31.1587.91.36
1524.967.32.7084.33.38
2517.531.51.8082.54.73
509.121.12.3182.49.01
1004.932.76.6277.615.73
1503.630.38.4173.020.25

PathSpec.match_files(): 6.5k files

Patternssimple
ops
hyperscan
ops

x
re2
ops

x
1165.5102.20.6287.80.53
565.784.21.2888.01.34
1529.272.42.4878.52.69
2516.032.82.0679.24.96
509.320.42.2077.08.29
1005.225.34.8374.414.21
1503.728.67.6872.819.58

PyPy 3.11.13 (7.3.20) on Intel(R) Xeon(R) CPU E5-2690 0 @ 2.90GHz

GitIgnoreSpec.match_files(): 6.5k files

Patternssimple
ops
hyperscan
ops

x
re2
ops

x
1307.442.50.14--
553.337.10.70--
1516.231.71.96--
257.822.42.86--
503.616.44.55--
1001.918.59.92--
1500.919.420.93--

PathSpec.match_files(): 6.5k files

Patternssimple
ops
hyperscan
ops

x
re2
ops

x
1314.541.80.13--
556.836.20.64--
1518.931.41.66--
259.422.12.34--
504.115.53.79--
1002.115.87.46--
1501.017.518.14--

CPython 3.13.11 on 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz

GitIgnoreSpec.match_files(): 6.5k files

Patternssimple
ops
hyperscan
ops

x
re2
ops

x
1271.9187.20.69196.30.72
5106.0161.11.52198.81.88
1546.1146.53.18193.34.19
2527.255.42.04191.87.05
5015.737.82.40190.712.12
1008.566.97.88190.922.47
1505.860.510.46173.029.91

PathSpec.match_files(): 6.5k files

Patternssimple
ops
hyperscan
ops

x
re2
ops

x
1276.2204.60.74194.90.71
5104.7172.01.64194.11.85
1547.2154.63.27184.53.91
2529.856.81.90183.86.16
5016.035.22.20181.811.39
1008.753.46.15179.720.69
1506.156.39.19176.828.84

PyPy 3.11.13 (7.3.20) on 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz

GitIgnoreSpec.match_files(): 6.5k files

Patternssimple
ops
hyperscan
ops

x
re2
ops

x
1578.2121.40.21--
5113.388.50.78--
1543.180.01.86--
2527.956.32.02--
5013.342.83.21--
1005.860.210.45--
1503.054.218.33--

PathSpec.match_files(): 6.5k files

Patternssimple
ops
hyperscan
ops

x
re2
ops

x
1577.3117.50.20--
5106.691.70.86--
1542.481.31.92--
2527.756.92.05--
5012.736.02.84--
1006.145.17.36--
1503.150.316.20--

PyPy 3.10.16 (7.3.19) on 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz

GitIgnoreSpec.match_files(): 6.5k files

Patternssimple
ops
hyperscan
ops

x
re2
ops

x
1589.9106.60.18--
5117.291.90.78--
1544.581.31.83--
2527.444.01.60--
5013.032.12.48--
1005.551.89.36--
1503.147.115.28--

PathSpec.match_files(): 6.5k files

Patternssimple
ops
hyperscan
ops

x
re2
ops

x
1581.4106.70.18--
5135.790.70.67--
1554.881.71.49--
2531.543.01.36--
5012.530.22.41--
1006.342.26.69--
1503.344.213.51--

CPython 3.13.11 on AMD RYZEN AI MAX+ 395 w/ Radeon 8060S

GitIgnoreSpec.match_files(): 6.5k files

Patternssimple
ops
hyperscan
ops

x
re2
ops

x
1426.1261.30.61291.50.68
5159.6230.21.44288.51.81
1569.4206.52.97279.34.02
2545.876.51.67275.96.02
5023.653.92.29275.111.66
10013.492.46.91271.320.29
1508.784.69.70246.528.26

PathSpec.match_files(): 6.5k files

Patternssimple
ops
hyperscan
ops

x
re2
ops

x
1439.1282.40.64289.70.66
5163.3244.61.50291.81.79
1576.5214.92.81272.93.57
2548.078.31.63271.85.66
5023.750.32.13268.311.34
10013.177.25.88264.020.10
1509.879.98.14263.726.87

PyPy 3.11.13 (7.3.20) on AMD RYZEN AI MAX+ 395 w/ Radeon 8060S

GitIgnoreSpec.match_files(): 6.5k files

Patternssimple
ops
hyperscan
ops

x
re2
ops

x
1898.6179.00.20--
5161.7132.00.82--
1562.8120.11.91--
2538.885.72.21--
5020.863.23.03--
1009.991.59.24--
1505.282.515.79--

PathSpec.match_files(): 6.5k files

Patternssimple
ops
hyperscan
ops

x
re2
ops

x
1913.0176.90.19--
5170.1132.70.78--
1569.7121.21.74--
2542.483.71.97--
5021.059.12.81--
10010.869.46.45--
1505.774.113.07--