Construct FunctionEmpty

Performance Diagrams

Construct FunctionEmpty 0020000002000000400000040000006000000600000080000008000000100000001000000012000000120000001400000014000000160000001600000018000000180000002000000020000000220000002200000024000000240000002600000026000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)2683817988.95192307692307257.0CPython 2.72800006242.31730769230768478.3340318784726Nuitka (master)3000504395.6826923076923476.48792524118494Nuitka (develop)3000000549.0480769230769476.4925658747334Nuitka (factory)Construct FunctionEmptyTicks Construct FunctionEmpty 00200000020000004000000400000060000006000000800000080000001000000010000000120000001200000014000000140000001600000016000000180000001800000020000000200000002200000022000000240000002400000026000000260000002800000028000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)2801386288.95192307692307257.0CPython 3.55150020242.31730769230768458.68611916541124Nuitka (master)5349986395.6826923076923456.9221826185688Nuitka (develop)5351846549.0480769230769456.9057752194253Nuitka (factory)Construct FunctionEmptyTicks

Source Code with Construct

def empty():
    pass

module_var = None

def calledRepeatedly():
    # We measure making that call or not. Lets get the module
    # variable look-up out of the game, by making it a local
    # variable
    called = empty

# construct_begin
    called()
# construct_end

import itertools
for x in itertools.repeat(None, 50000):
    calledRepeatedly()

print("OK.")

Source Code without Construct

def empty():
    pass

module_var = None

def calledRepeatedly():
    # We measure making that call or not. Lets get the module
    # variable look-up out of the game, by making it a local
    # variable
    called = empty

# construct_begin



import itertools
for x in itertools.repeat(None, 50000):
    calledRepeatedly()

print("OK.")

Context Diff of Source Code


Construct
Baseline
29     # variable look-up out of the game, by making it a local 29     # variable look-up out of the game, by making it a local
30     # variable 30     # variable
31     called = empty 31     called = empty
32 32
33 # construct_begin 33 # construct_begin
t 34     called() t 34  
35 # construct_end 35  
36 36
37 import itertools 37 import itertools
38 for x in itertools.repeat(None, 50000): 38 for x in itertools.repeat(None, 50000):
39     calledRepeatedly() 39     calledRepeatedly()
40 40

Context Diff of Generated Code


Construct
Baseline
176         tmp_assign_source_1 = tmp_mvar_value_1; 176         tmp_assign_source_1 = tmp_mvar_value_1;
177         assert(var_called == NULL); 177         assert(var_called == NULL);
178         Py_INCREF(tmp_assign_source_1); 178         Py_INCREF(tmp_assign_source_1);
179         var_called = tmp_assign_source_1; 179         var_called = tmp_assign_source_1;
180     } 180     }
n 181     { n
182         PyObject *tmp_called_name_1;
183         PyObject *tmp_call_result_1;
184         CHECK_OBJECT(var_called);
185         tmp_called_name_1 = var_called;
186         frame_5c300fe897ed580e928948c6477d93ce->m_frame.f_lineno = 34;
187         tmp_call_result_1 = CALL_FUNCTION_NO_ARGS(tmp_called_name_1);
188         if (tmp_call_result_1 == NULL) {
189             assert(ERROR_OCCURRED());
190  
191             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
192  
193  
194             exception_lineno = 34;
195             type_description_1 = "o";
196             goto frame_exception_exit_1;
197         }
198         Py_DECREF(tmp_call_result_1);
199     }
200 181
201 #if 0 182 #if 0
202     RESTORE_FRAME_EXCEPTION(frame_5c300fe897ed580e928948c6477d93ce); 183     RESTORE_FRAME_EXCEPTION(frame_5c300fe897ed580e928948c6477d93ce);
203 #endif 184 #endif
204 185
264     exception_keeper_lineno_1 = exception_lineno; 245     exception_keeper_lineno_1 = exception_lineno;
265     exception_type = NULL; 246     exception_type = NULL;
266     exception_value = NULL; 247     exception_value = NULL;
267     exception_tb = NULL; 248     exception_tb = NULL;
268     exception_lineno = 0; 249     exception_lineno = 0;
t 269   t
270     Py_XDECREF(var_called);
271     var_called = NULL;
272 250
273     // Re-raise. 251     // Re-raise.
274     exception_type = exception_keeper_type_1; 252     exception_type = exception_keeper_type_1;
275     exception_value = exception_keeper_value_1; 253     exception_value = exception_keeper_value_1;
276     exception_tb = exception_keeper_tb_1; 254     exception_tb = exception_keeper_tb_1;