diff options
author | Inada Naoki <songofacandy@gmail.com> | 2020-08-04 02:08:06 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-04 02:08:06 (GMT) |
commit | db6d9a50cee92c0ded7c5cb87331c5f0b1008698 (patch) | |
tree | d31cc67d2f51240386ba0dffd8c54275c60065cd /Lib/test/test_ordered_dict.py | |
parent | 602a971a2af3a685d625c912c400cadd452718b1 (diff) | |
download | cpython-db6d9a50cee92c0ded7c5cb87331c5f0b1008698.zip cpython-db6d9a50cee92c0ded7c5cb87331c5f0b1008698.tar.gz cpython-db6d9a50cee92c0ded7c5cb87331c5f0b1008698.tar.bz2 |
bpo-41431: Optimize dict_merge for copy (GH-21674)
Diffstat (limited to 'Lib/test/test_ordered_dict.py')
-rw-r--r-- | Lib/test/test_ordered_dict.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Lib/test/test_ordered_dict.py b/Lib/test/test_ordered_dict.py index 1f27c0e..31759f2 100644 --- a/Lib/test/test_ordered_dict.py +++ b/Lib/test/test_ordered_dict.py @@ -740,20 +740,21 @@ class CPythonOrderedDictTests(OrderedDictTests, unittest.TestCase): size = support.calcobjsize check = self.check_sizeof - basicsize = size('nQ2P' + '3PnPn2P') + calcsize('2nP2n') + basicsize = size('nQ2P' + '3PnPn2P') + keysize = calcsize('2nP2n') entrysize = calcsize('n2P') p = calcsize('P') nodesize = calcsize('Pn2P') od = OrderedDict() - check(od, basicsize + 8 + 5*entrysize) # 8byte indices + 8*2//3 * entry table + check(od, basicsize) # 8byte indices + 8*2//3 * entry table od.x = 1 - check(od, basicsize + 8 + 5*entrysize) + check(od, basicsize) od.update([(i, i) for i in range(3)]) - check(od, basicsize + 8*p + 8 + 5*entrysize + 3*nodesize) + check(od, basicsize + keysize + 8*p + 8 + 5*entrysize + 3*nodesize) od.update([(i, i) for i in range(3, 10)]) - check(od, basicsize + 16*p + 16 + 10*entrysize + 10*nodesize) + check(od, basicsize + keysize + 16*p + 16 + 10*entrysize + 10*nodesize) check(od.keys(), size('P')) check(od.items(), size('P')) |