Construct FunctionEmpty

Performance Diagrams

Construct FunctionEmpty 0020000002000000400000040000006000000600000080000008000000100000001000000012000000120000001400000014000000160000001600000018000000180000002000000020000000220000002200000024000000240000002600000026000000CPython 2.7Nuitka (historic)Nuitka (master)Nuitka (develop)Nuitka (factory)2757847073.61538461538461257.0CPython 2.72999550196.30769230769232477.23807953199616Nuitka (historic)2750000319.0000000000001479.4741587717353Nuitka (master)2749994441.69230769230774479.47421253440984Nuitka (develop)2750018564.3846153846155479.4739974837116Nuitka (factory)Construct FunctionEmptyTicks Construct FunctionEmpty 00200000020000004000000400000060000006000000800000080000001000000010000000120000001200000014000000140000001600000016000000180000001800000020000000200000002200000022000000240000002400000026000000260000002800000028000000CPython 3.5Nuitka (historic)Nuitka (master)Nuitka (develop)Nuitka (factory)2891570473.61538461538461257.0CPython 3.50196.30769230769232504.11538461538464Nuitka (historic)5155690319.0000000000001460.0545408155002Nuitka (master)5154065441.69230769230774460.068428165433Nuitka (develop)5150571564.3846153846155460.0982881043038Nuitka (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

for x in xrange(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



for x in xrange(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 for x in xrange(50000): 37 for x in xrange(50000):
38     calledRepeatedly() 38     calledRepeatedly()
39 39
40 print("OK.") 40 print("OK.")

Context Diff of Generated Code


Construct
Baseline
157     PyObject *exception_keeper_type_1; 157     PyObject *exception_keeper_type_1;
158     PyObject *exception_keeper_value_1; 158     PyObject *exception_keeper_value_1;
159     PyTracebackObject *exception_keeper_tb_1; 159     PyTracebackObject *exception_keeper_tb_1;
160     NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1; 160     NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1;
161     PyObject *tmp_assign_source_1; 161     PyObject *tmp_assign_source_1;
n 162     PyObject *tmp_called_name_1; n
163     PyObject *tmp_frame_locals; 162     PyObject *tmp_frame_locals;
164     PyObject *tmp_return_value; 163     PyObject *tmp_return_value;
n 165     NUITKA_MAY_BE_UNUSED PyObject *tmp_unused; n
166     static PyFrameObject *cache_frame_function = NULL; 164     static PyFrameObject *cache_frame_function = NULL;
167 165
168     PyFrameObject *frame_function; 166     PyFrameObject *frame_function;
169 167
170     tmp_return_value = NULL; 168     tmp_return_value = NULL;
209 207
210     assert( var_called == NULL ); 208     assert( var_called == NULL );
211     Py_INCREF( tmp_assign_source_1 ); 209     Py_INCREF( tmp_assign_source_1 );
212     var_called = tmp_assign_source_1; 210     var_called = tmp_assign_source_1;
213 211
n 214     tmp_called_name_1 = var_called; n
215  
216     frame_function->f_lineno = 34;
217     tmp_unused = CALL_FUNCTION_NO_ARGS( tmp_called_name_1 );
218     if ( tmp_unused == NULL )
219     {
220         assert( ERROR_OCCURRED() );
221  
222         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
223  
224  
225         exception_lineno = 34;
226         goto frame_exception_exit_1;
227     }
228     Py_DECREF( tmp_unused );
229 212
230 #if 0 213 #if 0
231     RESTORE_FRAME_EXCEPTION( frame_function ); 214     RESTORE_FRAME_EXCEPTION( frame_function );
232 #endif 215 #endif
233     // Put the previous frame back on top. 216     // Put the previous frame back on top.
299     // tried codes exits in all cases 282     // tried codes exits in all cases
300     NUITKA_CANNOT_GET_HERE( __main__$$$function_2_calledRepeatedly ); 283     NUITKA_CANNOT_GET_HERE( __main__$$$function_2_calledRepeatedly );
301     return NULL; 284     return NULL;
302     // Return handler code: 285     // Return handler code:
303     try_return_handler_1:; 286     try_return_handler_1:;
n n 287     CHECK_OBJECT( (PyObject *)var_called );
304     Py_XDECREF( var_called ); 288     Py_DECREF( var_called );
305     var_called = NULL; 289     var_called = NULL;
306 290
307     goto function_return_exit; 291     goto function_return_exit;
308     // Exception handler code: 292     // Exception handler code:
309     try_except_handler_1:; 293     try_except_handler_1:;
313     exception_keeper_lineno_1 = exception_lineno; 297     exception_keeper_lineno_1 = exception_lineno;
314     exception_type = NULL; 298     exception_type = NULL;
315     exception_value = NULL; 299     exception_value = NULL;
316     exception_tb = NULL; 300     exception_tb = NULL;
317     exception_lineno = -1; 301     exception_lineno = -1;
t 318   t
319     Py_XDECREF( var_called );
320     var_called = NULL;
321 302
322     // Re-raise. 303     // Re-raise.
323     exception_type = exception_keeper_type_1; 304     exception_type = exception_keeper_type_1;
324     exception_value = exception_keeper_value_1; 305     exception_value = exception_keeper_value_1;
325     exception_tb = exception_keeper_tb_1; 306     exception_tb = exception_keeper_tb_1;