Construct FunctionEmpty

Performance Diagrams

Construct FunctionEmpty 00200000020000004000000400000060000006000000800000080000001000000010000000120000001200000014000000140000001600000016000000180000001800000020000000200000002200000022000000240000002400000026000000260000002800000028000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)2903608088.95192307692307257.0CPython 2.72950114242.31730769230768479.00805071324527Nuitka (master)2950030395.6826923076923479.0087656063131Nuitka (develop)2950174549.0480769230769479.0075400753397Nuitka (factory)Construct FunctionEmptyTicks Construct FunctionEmpty 00200000020000004000000400000060000006000000800000080000001000000010000000120000001200000014000000140000001600000016000000180000001800000020000000200000002200000022000000240000002400000026000000260000002800000028000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)2941511488.95192307692307257.0CPython 3.55346222242.31730769230768459.2019531811488Nuitka (master)5350470395.6826923076923459.1662658758456Nuitka (develop)5350090549.0480769230769459.16945824308084Nuitka (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
210     assert( var_called == NULL ); 210     assert( var_called == NULL );
211     Py_INCREF( tmp_assign_source_1 ); 211     Py_INCREF( tmp_assign_source_1 );
212     var_called = tmp_assign_source_1; 212     var_called = tmp_assign_source_1;
213 213
214     } 214     }
n 215     { n
216     PyObject *tmp_called_name_1;
217     PyObject *tmp_call_result_1;
218     CHECK_OBJECT( var_called );
219     tmp_called_name_1 = var_called;
220     frame_5196f34602b8daffb4ea541c5cd424f3->m_frame.f_lineno = 34;
221     tmp_call_result_1 = CALL_FUNCTION_NO_ARGS( tmp_called_name_1 );
222     if ( tmp_call_result_1 == NULL )
223     {
224         assert( ERROR_OCCURRED() );
225  
226         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
227  
228  
229         exception_lineno = 34;
230         type_description_1 = "o";
231         goto frame_exception_exit_1;
232     }
233     Py_DECREF( tmp_call_result_1 );
234     }
235 215
236 #if 0 216 #if 0
237     RESTORE_FRAME_EXCEPTION( frame_5196f34602b8daffb4ea541c5cd424f3 ); 217     RESTORE_FRAME_EXCEPTION( frame_5196f34602b8daffb4ea541c5cd424f3 );
238 #endif 218 #endif
239 219
290     NUITKA_CANNOT_GET_HERE( __main__$$$function_2_calledRepeatedly ); 270     NUITKA_CANNOT_GET_HERE( __main__$$$function_2_calledRepeatedly );
291     return NULL; 271     return NULL;
292     // Return handler code: 272     // Return handler code:
293     try_return_handler_1:; 273     try_return_handler_1:;
294     { 274     {
n n 275     CHECK_OBJECT( (PyObject *)var_called );
295     Py_XDECREF( var_called ); 276     Py_DECREF( var_called );
296     var_called = NULL; 277     var_called = NULL;
297 278
298     } 279     }
299     { 280     {
300     goto function_return_exit; 281     goto function_return_exit;
308     exception_type = NULL; 289     exception_type = NULL;
309     exception_value = NULL; 290     exception_value = NULL;
310     exception_tb = NULL; 291     exception_tb = NULL;
311     exception_lineno = 0; 292     exception_lineno = 0;
312 293
t 313     { t
314     Py_XDECREF( var_called );
315     var_called = NULL;
316  
317     }
318     { 294     {
319     // Re-raise. 295     // Re-raise.
320     exception_type = exception_keeper_type_1; 296     exception_type = exception_keeper_type_1;
321     exception_value = exception_keeper_value_1; 297     exception_value = exception_keeper_value_1;
322     exception_tb = exception_keeper_tb_1; 298     exception_tb = exception_keeper_tb_1;