Ejemplo n.º 1
0
 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)
Ejemplo n.º 2
0
 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)
Ejemplo n.º 3
0
 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)
Ejemplo n.º 4
0
 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)
Ejemplo n.º 5
0
 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)
Ejemplo n.º 6
0
 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)
Ejemplo n.º 7
0
 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)
Ejemplo n.º 8
0
 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)
Ejemplo n.º 9
0
 def mem_size(self):
     sl = SkipList()
     self.add_result(getsize(sl))
Ejemplo n.º 10
0
 def mem_size(self):
     sl = SkipList()
     self.add_result(getsize(sl))