@@ -1619,7 +1619,7 @@ def test_runtime_comment_addition_for(self, test_config):
16191619 for i in range(3):
16201620 b = 3
16211621 b1 = 6
1622- codeflash_output = bubble_sort([3, 1, 2]) # 500μs -> 300μs (66.7 % faster)
1622+ codeflash_output = bubble_sort([3, 1, 2]) # 1.80ms -> 1.20ms (50.0 % faster)
16231623 assert codeflash_output == [1, 2, 3]
16241624 c = 4
16251625 d = 5
@@ -1640,7 +1640,6 @@ def test_runtime_comment_addition_for(self, test_config):
16401640 # Add test invocations with different runtimes
16411641 original_invocation1 = self .create_test_invocation ("test_bubble_sort" , 500_000 , iteration_id = '1_2_0' ) # 500μs
16421642 optimized_invocation1 = self .create_test_invocation ("test_bubble_sort" , 300_000 , iteration_id = '1_2_0' ) # 300μs
1643- # longer runtime than minimum, will not contribute
16441643 original_invocation2 = self .create_test_invocation ("test_bubble_sort" , 600_000 , iteration_id = '1_2_1' ) # 500μs
16451644 optimized_invocation2 = self .create_test_invocation ("test_bubble_sort" , 400_000 , iteration_id = '1_2_1' ) # 300μs
16461645 original_invocation3 = self .create_test_invocation ("test_bubble_sort" , 700_000 , iteration_id = '1_2_2' ) # 500μs
@@ -1680,7 +1679,7 @@ def test_runtime_comment_addition_while(self, test_config):
16801679 while i<3:
16811680 b = 3
16821681 b1 = 6
1683- codeflash_output = bubble_sort([3, 1, 2]) # 500μs -> 300μs (66.7 % faster)
1682+ codeflash_output = bubble_sort([3, 1, 2]) # 1.80ms -> 1.20ms (50.0 % faster)
16841683 assert codeflash_output == [1, 2, 3]
16851684 i += 1
16861685 d = 5
@@ -1701,7 +1700,6 @@ def test_runtime_comment_addition_while(self, test_config):
17011700 # Add test invocations with different runtimes
17021701 original_invocation1 = self .create_test_invocation ("test_bubble_sort" , 500_000 , iteration_id = '1_2_0' ) # 500μs
17031702 optimized_invocation1 = self .create_test_invocation ("test_bubble_sort" , 300_000 , iteration_id = '1_2_0' ) # 300μs
1704- # longer runtime than minimum, will not contribute
17051703 original_invocation2 = self .create_test_invocation ("test_bubble_sort" , 600_000 , iteration_id = '1_2_1' ) # 500μs
17061704 optimized_invocation2 = self .create_test_invocation ("test_bubble_sort" , 400_000 , iteration_id = '1_2_1' ) # 300μs
17071705 original_invocation3 = self .create_test_invocation ("test_bubble_sort" , 700_000 , iteration_id = '1_2_2' ) # 500μs
@@ -1741,7 +1739,7 @@ def test_runtime_comment_addition_with(self, test_config):
17411739 with open('a.txt','rb') as f:
17421740 b = 3
17431741 b1 = 6
1744- codeflash_output = bubble_sort([3, 1, 2]) # 500μs -> 300μs (66.7 % faster)
1742+ codeflash_output = bubble_sort([3, 1, 2]) # 1.80ms -> 1.20ms (50.0 % faster)
17451743 assert codeflash_output == [1, 2, 5]
17461744 i += 1
17471745 d = 5
@@ -1762,7 +1760,6 @@ def test_runtime_comment_addition_with(self, test_config):
17621760 # Add test invocations with different runtimes
17631761 original_invocation1 = self .create_test_invocation ("test_bubble_sort" , 500_000 , iteration_id = '1_2_0' ) # 500μs
17641762 optimized_invocation1 = self .create_test_invocation ("test_bubble_sort" , 300_000 , iteration_id = '1_2_0' ) # 300μs
1765- # longer runtime than minimum, will not contribute
17661763 original_invocation2 = self .create_test_invocation ("test_bubble_sort" , 600_000 , iteration_id = '1_2_1' ) # 500μs
17671764 optimized_invocation2 = self .create_test_invocation ("test_bubble_sort" , 400_000 , iteration_id = '1_2_1' ) # 300μs
17681765 original_invocation3 = self .create_test_invocation ("test_bubble_sort" , 700_000 , iteration_id = '1_2_2' ) # 500μs
@@ -1796,7 +1793,7 @@ def test_runtime_comment_addition_lc(self, test_config):
17961793"""
17971794 expected = """def test_bubble_sort():
17981795 i = 0
1799- codeflash_output = [bubble_sort([3, 1, 2]) for _ in range(3)] # 500μs -> 300μs (66.7 % faster)
1796+ codeflash_output = [bubble_sort([3, 1, 2]) for _ in range(3)] # 1.80ms -> 1.20ms (50.0 % faster)
18001797 assert codeflash_output == [[1,2,3],[1,2,3],[1,2,3]]
18011798 i += 1
18021799 d = 5
@@ -1817,7 +1814,6 @@ def test_runtime_comment_addition_lc(self, test_config):
18171814 # Add test invocations with different runtimes
18181815 original_invocation1 = self .create_test_invocation ("test_bubble_sort" , 500_000 , iteration_id = '1_0' ) # 500μs
18191816 optimized_invocation1 = self .create_test_invocation ("test_bubble_sort" , 300_000 , iteration_id = '1_0' ) # 300μs
1820- # longer runtime than minimum, will not contribute
18211817 original_invocation2 = self .create_test_invocation ("test_bubble_sort" , 600_000 , iteration_id = '1_1' ) # 500μs
18221818 optimized_invocation2 = self .create_test_invocation ("test_bubble_sort" , 400_000 , iteration_id = '1_1' ) # 300μs
18231819 original_invocation3 = self .create_test_invocation ("test_bubble_sort" , 700_000 , iteration_id = '1_2' ) # 500μs
@@ -1867,7 +1863,7 @@ def test_bubble_sort(input, expected_output):
18671863)
18681864def test_bubble_sort(input, expected_output):
18691865 i = 0
1870- codeflash_output = bubble_sort(input) # 500μs -> 300μs (66.7 % faster)
1866+ codeflash_output = bubble_sort(input) # 1.80ms -> 1.20ms (50.0 % faster)
18711867 assert codeflash_output == expected_output
18721868 i += 1
18731869 d = 5
@@ -1888,7 +1884,6 @@ def test_bubble_sort(input, expected_output):
18881884 # Add test invocations with different runtimes
18891885 original_invocation1 = self .create_test_invocation ("test_bubble_sort" , 500_000 , iteration_id = '1_0' ) # 500μs
18901886 optimized_invocation1 = self .create_test_invocation ("test_bubble_sort" , 300_000 , iteration_id = '1_0' ) # 300μs
1891- # longer runtime than minimum, will not contribute
18921887 original_invocation2 = self .create_test_invocation ("test_bubble_sort" , 600_000 , iteration_id = '1_1' ) # 500μs
18931888 optimized_invocation2 = self .create_test_invocation ("test_bubble_sort" , 400_000 , iteration_id = '1_1' ) # 300μs
18941889 original_invocation3 = self .create_test_invocation ("test_bubble_sort" , 700_000 , iteration_id = '1_2' ) # 500μs
0 commit comments