def test3(): pq = heap.init() totalPushes=0 pushes=0 while(totalPushes<1000000): for x in range(randint(1,100)): heap.push(pq,(randint(0,10000), {"rx" : "a", "tx" : "b", "txID" : 1, "rxID" : 1, "name" : "bob", "data": "none", })) totalPushes+=1 pushes+=1 #for x in range(10000) : # y=heap.peak(pq) for x in range(randint(1,100)): if (pushes): pushes-=1 #y = heap.pop(pq) else: break
def test2(): pq = heap.init() for x in range(1000000) : heap.push(pq,(randint(0,10000), {"rx" : "a", "tx" : "b", "txID" : 1, "rxID" : 1, "name" : "bob", "data": "none", }))
def test1(): pq = heap.init() for x in range(1000000) : heap.push(pq,(x, {"rx" : "a", "tx" : "b", "txID" : 1, "rxID" : 1, "name" : "bob", "data": "none", })) #print x #for x in range(1000000) : # y=heap.peak(pq) for x in range(1000000): #y = heap.pop(pq) #print y[0] #print y #print "\n" pass
import heap from random import randint import sys import timeit REPEATS = 10 NUMBER = 10 # push in increasing pq = heap.init(None) def test1(): for x in range(1000000): heap.push(pq, (x, { "rx": "a", "tx": "b", "txID": 1, "rxID": 1, "name": "bob", "data": "none", })) #for x in range(1000000) : # y=heap.peak(pq) for x in range(1000000): y = heap.pop(pq) #print y #print "\n"
import heap from random import randint import sys import timeit REPEATS = 10 NUMBER = 10 # push in increasing pq = heap.init() def test1(): for x in range(1000000): heap.push(pq, (x, { "rx": "a", "tx": "b", "txID": 1, "rxID": 1, "name": "bob", "data": "none", })) #for x in range(1000000) : # y=heap.peak(pq) for x in range(1000000): y = heap.pop(pq) #print y #print "\n"