def test_Performance_HugeInput():
    start_time = time.time()
    print("Performance test huge input")
    randomizedList = createRandomIntegerList(500000)
    tracemalloc.start()
    merge.mergeIntervals(randomizedList)
    current, peak = tracemalloc.get_traced_memory()
    print("Memory usage: %s MB" % (peak / 10**6))
    tracemalloc.stop()
    print("--- %s seconds ---" % (time.time() - start_time))
Esempio n. 2
0
 def test_mergeIntervals_Function(self):
     self.assertEqual(merge.mergeIntervals([[25,30],[2,19],[14,23],[4,8]]), [[2,23],[25,30]])
Esempio n. 3
0
 def test_mergeIntervals_OnEmptyList(self):
     self.assertEqual(merge.mergeIntervals([]), [])