1
0
mirror of https://github.com/github/octodns.git synced 2024-05-11 05:55:00 +00:00

Fix major performance issue with add_record O(N^2)

Before, 1-2k record took ~10s and more than that was just painful, 5k took
forever. This records things to keep a dict of nodes with a set of records so
that we can quickly "jump" to the point we're looking for without having to
search. 10k records now takes ~5s.
This commit is contained in:
Ross McFarland
2017-07-02 18:23:45 -07:00
parent 69817ab465
commit 908698da49
8 changed files with 44 additions and 30 deletions

View File

@@ -196,7 +196,8 @@ class TestNs1Provider(TestCase):
provider = Ns1Provider('test', 'api-key')
desired = Zone('unit.tests.', [])
desired.records.update(self.expected)
for r in self.expected:
desired.add_record(r)
plan = provider.plan(desired)
# everything except the root NS