Patchwork [1,of,3,diffset-extra] revset: use _diffset in lazyset.__sub__

mail settings
Submitter Gregory Szorc
Date Sept. 8, 2014, 10 p.m.
Message ID <b590210d167f2a0f6445.1410213650@gps-mbp.local>
Download mbox | patch
Permalink /patch/5733/
State Deferred
Headers show


Gregory Szorc - Sept. 8, 2014, 10 p.m.
# HG changeset patch
# User Gregory Szorc <>
# Date 1410200337 25200
#      Mon Sep 08 11:18:57 2014 -0700
# Node ID b590210d167f2a0f6445f58427d70af7cde96be5
# Parent  d2c3dd725cf9b64b564f13096102f61f6b0d06ba
revset: use _diffset in lazyset.__sub__

On a clone of the Firefox repository with several heads, this change
appeared to have no statistically significant impact on revset
benchmarks. On initial glance, the author() revsets appeared to be
slightly slower. However, subsequent investigation revealed that this
was likely due to insufficient sample size (3 runs due to long
execution time). If run enough times, results are consistent with


diff --git a/mercurial/ b/mercurial/
--- a/mercurial/
+++ b/mercurial/
@@ -2350,9 +2350,9 @@  class lazyset(object):
     def __and__(self, x):
         return lazyset(self, x.__contains__)
     def __sub__(self, x):
-        return lazyset(self, lambda r: r not in x)
+        return _diffset(self, x)
     def __add__(self, x):
         return _addset(self, x)