Construct FunctionEmpty
Performance Diagrams
Source Code with Construct
# construct_end return called for x in itertools.repeat(None, 50000): calledRepeatedly(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
return called for x in itertools.repeat(None, 50000): calledRepeatedly(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 | ||||
---|---|---|---|---|---|
14 | def calledRepeatedly(called): | 14 | def calledRepeatedly(called): | ||
15 | # Force a frame for now | 15 | # Force a frame for now | ||
16 | module_var | 16 | module_var | ||
17 | 17 | ||||
18 | # construct_begin | 18 | # construct_begin | ||
t | 19 | called() | t | 19 | |
20 | # construct_end | 20 | |||
21 | 21 | ||||
22 | return called | 22 | return called | ||
23 | 23 | ||||
24 | 24 | ||||
25 | for x in itertools.repeat(None, 50000): | 25 | for x in itertools.repeat(None, 50000): |
Context Diff of Generated Code
Construct | Baseline | ||||
---|---|---|---|---|---|
163 | exception_lineno = 16; | 163 | exception_lineno = 16; | ||
164 | type_description_1 = "o"; | 164 | type_description_1 = "o"; | ||
165 | goto frame_exception_exit_1; | 165 | goto frame_exception_exit_1; | ||
166 | } | 166 | } | ||
167 | } | 167 | } | ||
t | 168 | { | t | ||
169 | PyObject *tmp_called_value_1; | ||||
170 | PyObject *tmp_call_result_1; | ||||
171 | CHECK_OBJECT(par_called); | ||||
172 | tmp_called_value_1 = par_called; | ||||
173 | frame_d05bb6cc0f87d202ef1731eaf6528438->m_frame.f_lineno = 19; | ||||
174 | tmp_call_result_1 = CALL_FUNCTION_NO_ARGS(tstate, tmp_called_value_1); | ||||
175 | if (tmp_call_result_1 == NULL) { | ||||
176 | assert(HAS_ERROR_OCCURRED(tstate)); | ||||
177 | |||||
178 | FETCH_ERROR_OCCURRED(tstate, &exception_type, &exception_value, &exception_tb); | ||||
179 | |||||
180 | |||||
181 | exception_lineno = 19; | ||||
182 | type_description_1 = "o"; | ||||
183 | goto frame_exception_exit_1; | ||||
184 | } | ||||
185 | Py_DECREF(tmp_call_result_1); | ||||
186 | } | ||||
187 | 168 | ||||
188 | 169 | ||||
189 | // Put the previous frame back on top. | 170 | // Put the previous frame back on top. | ||
190 | popFrameStack(tstate); | 171 | popFrameStack(tstate); | ||
191 | 172 |