Construct BuiltinSumWithTuple
Performance Diagrams
Source Code with Construct
return x, y for x in itertools.repeat(None, 50000): calledRepeatedly(value, empty) print("OK.") # Python test originally created or extracted from other peoples work. The # parts from me are licensed as below. It is at least Free Software where # it's copied from other people. In these cases, that will normally be # indicated. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License.
Source Code without Construct
y = sum(empty) # construct_end return x, y for x in itertools.repeat(None, 50000): calledRepeatedly(value, empty) print("OK.") # Python test originally created or extracted from other peoples work. The # parts from me are licensed as below. It is at least Free Software where # it's copied from other people. In these cases, that will normally be # indicated. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License.
Context Diff of Source Code
Construct | Baseline | ||||
---|---|---|---|---|---|
13 | value | 13 | value | ||
14 | 14 | ||||
15 | # We measure making a tuple iterator step or not. | 15 | # We measure making a tuple iterator step or not. | ||
16 | 16 | ||||
17 | # construct_begin | 17 | # construct_begin | ||
n | 18 | y = sum(iterable) | n | 18 | |
19 | # construct_alternative | 19 | # construct_alternative | ||
t | 20 | t | 20 | y = sum(empty) | |
21 | 21 | # construct_end | |||
22 | 22 | ||||
23 | return x, y | 23 | return x, y | ||
24 | 24 | ||||
25 | 25 | ||||
26 | for x in itertools.repeat(None, 50000): | 26 | for x in itertools.repeat(None, 50000): |
Context Diff of Generated Code
Construct | Baseline | ||||
---|---|---|---|---|---|
168 | } | 168 | } | ||
169 | } | 169 | } | ||
170 | { | 170 | { | ||
171 | PyObject *tmp_assign_source_1; | 171 | PyObject *tmp_assign_source_1; | ||
172 | PyObject *tmp_sum_sequence_1; | 172 | PyObject *tmp_sum_sequence_1; | ||
n | 173 | CHECK_OBJECT(par_iterable); | n | 173 | CHECK_OBJECT(par_empty); |
174 | tmp_sum_sequence_1 = par_iterable; | 174 | tmp_sum_sequence_1 = par_empty; | ||
175 | tmp_assign_source_1 = BUILTIN_SUM1(tstate, tmp_sum_sequence_1); | 175 | tmp_assign_source_1 = BUILTIN_SUM1(tstate, tmp_sum_sequence_1); | ||
176 | if (tmp_assign_source_1 == NULL) { | 176 | if (tmp_assign_source_1 == NULL) { | ||
177 | assert(HAS_ERROR_OCCURRED(tstate)); | 177 | assert(HAS_ERROR_OCCURRED(tstate)); | ||
178 | 178 | ||||
179 | FETCH_ERROR_OCCURRED(tstate, &exception_type, &exception_value, &exception_tb); | 179 | FETCH_ERROR_OCCURRED(tstate, &exception_type, &exception_value, &exception_tb); | ||
180 | 180 | ||||
181 | 181 | ||||
t | 182 | exception_lineno = 18; | t | 182 | exception_lineno = 20; |
183 | type_description_1 = "ooo"; | 183 | type_description_1 = "ooo"; | ||
184 | goto frame_exception_exit_1; | 184 | goto frame_exception_exit_1; | ||
185 | } | 185 | } | ||
186 | assert(var_y == NULL); | 186 | assert(var_y == NULL); | ||
187 | var_y = tmp_assign_source_1; | 187 | var_y = tmp_assign_source_1; |