Construct FunctionEmpty

Performance Diagrams

Construct FunctionEmpty 0020000002000000400000040000006000000600000080000008000000100000001000000012000000120000001400000014000000160000001600000018000000180000002000000020000000220000002200000024000000240000002600000026000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)2683817988.95192307692307257.0CPython 2.72800006242.31730769230768478.3340318784726Nuitka (master)3000168395.6826923076923476.4910189968839Nuitka (develop)2999910549.0480769230769476.49339455929555Nuitka (factory)Construct FunctionEmptyTicks Construct FunctionEmpty 00200000020000004000000400000060000006000000800000080000001000000010000000120000001200000014000000140000001600000016000000180000001800000020000000200000002200000022000000240000002400000026000000260000002800000028000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)2801386288.95192307692307257.0CPython 3.55149938242.31730769230768458.6868425023627Nuitka (master)5350042395.6826923076923456.92168863235804Nuitka (develop)5349996549.0480769230769456.92209440674543Nuitka (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
178         tmp_assign_source_1 = tmp_mvar_value_1; 178         tmp_assign_source_1 = tmp_mvar_value_1;
179         assert(var_called == NULL); 179         assert(var_called == NULL);
180         Py_INCREF(tmp_assign_source_1); 180         Py_INCREF(tmp_assign_source_1);
181         var_called = tmp_assign_source_1; 181         var_called = tmp_assign_source_1;
182     } 182     }
n 183     { n
184         PyObject *tmp_called_name_1;
185         PyObject *tmp_call_result_1;
186         CHECK_OBJECT(var_called);
187         tmp_called_name_1 = var_called;
188         frame_a9aa369f84c50c68137dae8acb71a509->m_frame.f_lineno = 34;
189         tmp_call_result_1 = CALL_FUNCTION_NO_ARGS( tmp_called_name_1 );
190         if ( tmp_call_result_1 == NULL )
191         {
192             assert(ERROR_OCCURRED());
193  
194             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
195  
196  
197             exception_lineno = 34;
198             type_description_1 = "o";
199             goto frame_exception_exit_1;
200         }
201         Py_DECREF(tmp_call_result_1);
202     }
203 183
204 #if 0 184 #if 0
205     RESTORE_FRAME_EXCEPTION(frame_a9aa369f84c50c68137dae8acb71a509); 185     RESTORE_FRAME_EXCEPTION(frame_a9aa369f84c50c68137dae8acb71a509);
206 #endif 186 #endif
207 187
267     exception_keeper_lineno_1 = exception_lineno; 247     exception_keeper_lineno_1 = exception_lineno;
268     exception_type = NULL; 248     exception_type = NULL;
269     exception_value = NULL; 249     exception_value = NULL;
270     exception_tb = NULL; 250     exception_tb = NULL;
271     exception_lineno = 0; 251     exception_lineno = 0;
t 272   t
273     Py_XDECREF(var_called);
274     var_called = NULL;
275 252
276     // Re-raise. 253     // Re-raise.
277     exception_type = exception_keeper_type_1; 254     exception_type = exception_keeper_type_1;
278     exception_value = exception_keeper_value_1; 255     exception_value = exception_keeper_value_1;
279     exception_tb = exception_keeper_tb_1; 256     exception_tb = exception_keeper_tb_1;