Construct FunctionEmpty

Performance Diagrams

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