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)2750716441.69230769230774479.4677430925702Nuitka (develop)2799610564.3846153846155479.02963105751587Nuitka (factory)Construct FunctionEmptyTicks Construct FunctionEmpty 00200000020000004000000400000060000006000000800000080000001000000010000000120000001200000014000000140000001600000016000000180000001800000020000000200000002200000022000000240000002400000026000000260000002800000028000000CPython 3.5Nuitka (historic)Nuitka (master)Nuitka (develop)Nuitka (factory)2891570473.61538461538461257.0CPython 3.50196.30769230769232504.11538461538464Nuitka (historic)5152981319.0000000000001460.0776920960958Nuitka (master)5249628441.69230769230774459.2517408905875Nuitka (develop)5147679564.3846153846155460.1230033141534Nuitka (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_return_value; 162     PyObject *tmp_return_value;
n 164     NUITKA_MAY_BE_UNUSED PyObject *tmp_unused; n
165     static struct Nuitka_FrameObject *cache_frame_function = NULL; 163     static struct Nuitka_FrameObject *cache_frame_function = NULL;
166 164
167     struct Nuitka_FrameObject *frame_function; 165     struct Nuitka_FrameObject *frame_function;
168 166
169     char const *type_description; 167     char const *type_description;
205 203
206     assert( var_called == NULL ); 204     assert( var_called == NULL );
207     Py_INCREF( tmp_assign_source_1 ); 205     Py_INCREF( tmp_assign_source_1 );
208     var_called = tmp_assign_source_1; 206     var_called = tmp_assign_source_1;
209 207
n 210     tmp_called_name_1 = var_called; n
211  
212     frame_function->m_frame.f_lineno = 34;
213     tmp_unused = CALL_FUNCTION_NO_ARGS( tmp_called_name_1 );
214     if ( tmp_unused == NULL )
215     {
216         assert( ERROR_OCCURRED() );
217  
218         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
219  
220  
221         exception_lineno = 34;
222         type_description = "o";
223         goto frame_exception_exit_1;
224     }
225     Py_DECREF( tmp_unused );
226 208
227 #if 0 209 #if 0
228     RESTORE_FRAME_EXCEPTION( frame_function ); 210     RESTORE_FRAME_EXCEPTION( frame_function );
229 #endif 211 #endif
230 212
274     // tried codes exits in all cases 256     // tried codes exits in all cases
275     NUITKA_CANNOT_GET_HERE( __main__$$$function_2_calledRepeatedly ); 257     NUITKA_CANNOT_GET_HERE( __main__$$$function_2_calledRepeatedly );
276     return NULL; 258     return NULL;
277     // Return handler code: 259     // Return handler code:
278     try_return_handler_1:; 260     try_return_handler_1:;
n n 261     CHECK_OBJECT( (PyObject *)var_called );
279     Py_XDECREF( var_called ); 262     Py_DECREF( var_called );
280     var_called = NULL; 263     var_called = NULL;
281 264
282     goto function_return_exit; 265     goto function_return_exit;
283     // Exception handler code: 266     // Exception handler code:
284     try_except_handler_1:; 267     try_except_handler_1:;
288     exception_keeper_lineno_1 = exception_lineno; 271     exception_keeper_lineno_1 = exception_lineno;
289     exception_type = NULL; 272     exception_type = NULL;
290     exception_value = NULL; 273     exception_value = NULL;
291     exception_tb = NULL; 274     exception_tb = NULL;
292     exception_lineno = -1; 275     exception_lineno = -1;
t 293   t
294     Py_XDECREF( var_called );
295     var_called = NULL;
296 276
297     // Re-raise. 277     // Re-raise.
298     exception_type = exception_keeper_type_1; 278     exception_type = exception_keeper_type_1;
299     exception_value = exception_keeper_value_1; 279     exception_value = exception_keeper_value_1;
300     exception_tb = exception_keeper_tb_1; 280     exception_tb = exception_keeper_tb_1;