Construct FunctionEmpty
Performance Diagrams
Source Code with Construct
def empty(): pass module_var = None def calledRepeatedly(called): # Force a frame for now module_var # construct_begin called() # construct_end return called import itertools for x in itertools.repeat(None, 50000): calledRepeatedly(empty) print("OK.")
Source Code without Construct
def empty(): pass module_var = None def calledRepeatedly(called): # Force a frame for now module_var # construct_begin return called import itertools for x in itertools.repeat(None, 50000): calledRepeatedly(empty) print("OK.")
Context Diff of Source Code
Construct | Baseline | ||||
---|---|---|---|---|---|
27 | def calledRepeatedly(called): | 27 | def calledRepeatedly(called): | ||
28 | # Force a frame for now | 28 | # Force a frame for now | ||
29 | module_var | 29 | module_var | ||
30 | 30 | ||||
31 | # construct_begin | 31 | # construct_begin | ||
t | 32 | called() | t | 32 | |
33 | # construct_end | 33 | |||
34 | 34 | ||||
35 | return called | 35 | return called | ||
36 | 36 | ||||
37 | import itertools | 37 | import itertools | ||
38 | for x in itertools.repeat(None, 50000): | 38 | for x in itertools.repeat(None, 50000): |
Context Diff of Generated Code
Construct | Baseline | ||||
---|---|---|---|---|---|
162 | exception_lineno = 29; | 162 | exception_lineno = 29; | ||
163 | type_description_1 = "o"; | 163 | type_description_1 = "o"; | ||
164 | goto frame_exception_exit_1; | 164 | goto frame_exception_exit_1; | ||
165 | } | 165 | } | ||
166 | } | 166 | } | ||
t | 167 | { | t | ||
168 | PyObject *tmp_called_value_1; | ||||
169 | PyObject *tmp_call_result_1; | ||||
170 | CHECK_OBJECT(par_called); | ||||
171 | tmp_called_value_1 = par_called; | ||||
172 | frame_042169dd208e563e77acd9eea3448da0->m_frame.f_lineno = 32; | ||||
173 | tmp_call_result_1 = CALL_FUNCTION_NO_ARGS(tmp_called_value_1); | ||||
174 | if (tmp_call_result_1 == NULL) { | ||||
175 | assert(ERROR_OCCURRED()); | ||||
176 | |||||
177 | FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb); | ||||
178 | |||||
179 | |||||
180 | exception_lineno = 32; | ||||
181 | type_description_1 = "o"; | ||||
182 | goto frame_exception_exit_1; | ||||
183 | } | ||||
184 | Py_DECREF(tmp_call_result_1); | ||||
185 | } | ||||
186 | 167 | ||||
187 | #if 0 | 168 | #if 0 | ||
188 | RESTORE_FRAME_EXCEPTION(frame_042169dd208e563e77acd9eea3448da0); | 169 | RESTORE_FRAME_EXCEPTION(frame_042169dd208e563e77acd9eea3448da0); | ||
189 | #endif | 170 | #endif | ||
190 | 171 |