Construct FunctionEmpty

Performance Diagrams

Construct FunctionEmpty 00200000020000004000000400000060000006000000800000080000001000000010000000120000001200000014000000140000001600000016000000180000001800000020000000200000002200000022000000240000002400000026000000260000002800000028000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)2903608088.95192307692307257.0CPython 2.72949964242.31730769230768479.0093273080092Nuitka (master)2950024395.6826923076923479.0088166701036Nuitka (develop)2949886549.0480769230769479.0099911372864Nuitka (factory)Construct FunctionEmptyTicks Construct FunctionEmpty 00200000020000004000000400000060000006000000800000080000001000000010000000120000001200000014000000140000001600000016000000180000001800000020000000200000002200000022000000240000002400000026000000260000002800000028000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)2941511488.95192307692307257.0CPython 3.55358790242.31730769230768459.0963698353271Nuitka (master)5301606395.6826923076923459.5767706984292Nuitka (develop)5297554549.0480769230769459.61081141431634Nuitka (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_c3382e3b115f7810546a94a49e3b2c3e->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_c3382e3b115f7810546a94a49e3b2c3e ); 217     RESTORE_FRAME_EXCEPTION( frame_c3382e3b115f7810546a94a49e3b2c3e );
238 #endif 218 #endif
239 219
309     exception_type = NULL; 289     exception_type = NULL;
310     exception_value = NULL; 290     exception_value = NULL;
311     exception_tb = NULL; 291     exception_tb = NULL;
312     exception_lineno = 0; 292     exception_lineno = 0;
313 293
t 314     { t
315     Py_XDECREF( var_called );
316     var_called = NULL;
317  
318     }
319     { 294     {
320     // Re-raise. 295     // Re-raise.
321     exception_type = exception_keeper_type_1; 296     exception_type = exception_keeper_type_1;
322     exception_value = exception_keeper_value_1; 297     exception_value = exception_keeper_value_1;
323     exception_tb = exception_keeper_tb_1; 298     exception_tb = exception_keeper_tb_1;