def test_size(self): sl = SkipList() sl.insert('foo', 'bar') size = getsize(sl) self.assertIsInstance(size, int) self.assertGreater(size, 0) self.assertLess(size, 5000)
def test_node_size(self): sl = SkipList() for i in range(1000): sl.insert(i, None) size = getsize(sl) self.assertIsInstance(size, int) self.assertGreater(size, 0) self.assertLess(size/1000, 250)
def mem_node_overhead(self): for logN in range(3, 6): items = 10 ** logN sl = SkipList() for i in range(items): sl.insert(i, i) overhead = getsize(sl) - items * 2 * sys.getsizeof(i) self.add_result(overhead / items, suffix=items)
def mem_node_size(self): for logN in range(3, 6): items = 10 ** logN sl = SkipList() for i in range(items): sl.insert(i, i) size = getsize(sl) self.add_result(size / items, suffix=items)
def test_node_size(self): sl = SkipList() for i in range(1000): sl.insert(i, None) size = getsize(sl) self.assertIsInstance(size, int) self.assertGreater(size, 0) self.assertLess(size / 1000, 250)
def mem_node_overhead(self): for logN in range(3, 6): items = 10**logN sl = SkipList() for i in range(items): sl.insert(i, i) overhead = getsize(sl) - items * 2 * sys.getsizeof(i) self.add_result(overhead / items, suffix=items)
def mem_node_size(self): for logN in range(3, 6): items = 10**logN sl = SkipList() for i in range(items): sl.insert(i, i) size = getsize(sl) self.add_result(size / items, suffix=items)
def mem_size(self): sl = SkipList() self.add_result(getsize(sl))