From: Michal 'vorner' Vaner Date: Mon, 3 Oct 2011 09:02:27 +0000 (+0200) Subject: [1259] Use a constant for 100 updates X-Git-Tag: perftcpdns_before_epoll~37^2~30^2^2~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=471edfd7a86d91f04536bc7c7fb42ad7239e1731;p=thirdparty%2Fkea.git [1259] Use a constant for 100 updates --- diff --git a/src/lib/python/isc/xfrin/diff.py b/src/lib/python/isc/xfrin/diff.py index 6c0540121b..962e51c283 100644 --- a/src/lib/python/isc/xfrin/diff.py +++ b/src/lib/python/isc/xfrin/diff.py @@ -26,6 +26,17 @@ class NoSuchZone(Exception): """ pass +""" +This is the amount of changes we accumulate before calling Diff.apply +automatically. + +The number 100 is just taken from Bind9. We don't know the rationale +for exactly this amount, but we think it is just some randomly chosen +number. +""" +# If changing this, modify the tests accordingly as well. +DIFF_APPLY_TRESHOLD = 100 + class Diff: """ The class represents a diff against current state of datasource on @@ -81,7 +92,7 @@ class Diff: raise ValueError('The rrset must contain exactly 1 Rdata, but ' + 'it holds ' + str(rr.get_rdata_count())) self.__buffer.append((operation, rr)) - if len(self.__buffer) >= 100: + if len(self.__buffer) >= DIFF_APPLY_TRESHOLD: # Time to auto-apply, so the data don't accumulate too much self.apply()