Construct FunctionEmpty

Performance Diagrams

Construct FunctionEmpty 00200000020000004000000400000060000006000000800000080000001000000010000000120000001200000014000000140000001600000016000000180000001800000020000000200000002200000022000000240000002400000026000000260000002800000028000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)2848628088.95192307692307257.0CPython 2.72950018242.31730769230768478.5242989175572Nuitka (master)2950018395.6826923076923478.5242989175572Nuitka (develop)2949994549.0480769230769478.52450711495015Nuitka (factory)Construct FunctionEmptyTicks Construct FunctionEmpty 00200000020000004000000400000060000006000000800000080000001000000010000000120000001200000014000000140000001600000016000000180000001800000020000000200000002200000022000000240000002400000026000000260000002800000028000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)2961336588.95192307692307257.0CPython 3.55300772242.31730769230768459.88190045921186Nuitka (master)5296360395.6826923076923459.91871738551936Nuitka (develop)5303562549.0480769230769459.85861867671Nuitka (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
213         tmp_assign_source_1 = tmp_mvar_value_1; 213         tmp_assign_source_1 = tmp_mvar_value_1;
214         assert( var_called == NULL ); 214         assert( var_called == NULL );
215         Py_INCREF( tmp_assign_source_1 ); 215         Py_INCREF( tmp_assign_source_1 );
216         var_called = tmp_assign_source_1; 216         var_called = tmp_assign_source_1;
217     } 217     }
n 218     { n
219         PyObject *tmp_called_name_1;
220         PyObject *tmp_call_result_1;
221         CHECK_OBJECT( var_called );
222         tmp_called_name_1 = var_called;
223         frame_c6cb9cbf3621eba2cf33b98059e1dad5->m_frame.f_lineno = 34;
224         tmp_call_result_1 = CALL_FUNCTION_NO_ARGS( tmp_called_name_1 );
225         if ( tmp_call_result_1 == NULL )
226         {
227             assert( ERROR_OCCURRED() );
228  
229             FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
230  
231  
232             exception_lineno = 34;
233             type_description_1 = "o";
234             goto frame_exception_exit_1;
235         }
236         Py_DECREF( tmp_call_result_1 );
237     }
238 218
239 #if 0 219 #if 0
240     RESTORE_FRAME_EXCEPTION( frame_c6cb9cbf3621eba2cf33b98059e1dad5 ); 220     RESTORE_FRAME_EXCEPTION( frame_c6cb9cbf3621eba2cf33b98059e1dad5 );
241 #endif 221 #endif
242 222
305     exception_keeper_lineno_1 = exception_lineno; 285     exception_keeper_lineno_1 = exception_lineno;
306     exception_type = NULL; 286     exception_type = NULL;
307     exception_value = NULL; 287     exception_value = NULL;
308     exception_tb = NULL; 288     exception_tb = NULL;
309     exception_lineno = 0; 289     exception_lineno = 0;
t 310   t
311     Py_XDECREF( var_called );
312     var_called = NULL;
313 290
314     // Re-raise. 291     // Re-raise.
315     exception_type = exception_keeper_type_1; 292     exception_type = exception_keeper_type_1;
316     exception_value = exception_keeper_value_1; 293     exception_value = exception_keeper_value_1;
317     exception_tb = exception_keeper_tb_1; 294     exception_tb = exception_keeper_tb_1;