Construct FunctionEmpty

Performance Diagrams

Construct FunctionEmpty 0020000002000000400000040000006000000600000080000008000000100000001000000012000000120000001400000014000000160000001600000018000000180000002000000020000000220000002200000024000000240000002600000026000000CPython 2.7Nuitka (historic)Nuitka (master)Nuitka (develop)Nuitka (factory)2757847073.61538461538461257.0CPython 2.72999550196.30769230769232477.23807953199616Nuitka (historic)2799619319.0000000000001479.029550413504Nuitka (master)2749833441.69230769230774479.47565516617743Nuitka (develop)2750492564.3846153846155479.4697502324207Nuitka (factory)Construct FunctionEmptyTicks Construct FunctionEmpty 00200000020000004000000400000060000006000000800000080000001000000010000000120000001200000014000000140000001600000016000000180000001800000020000000200000002200000022000000240000002400000026000000260000002800000028000000CPython 3.5Nuitka (historic)Nuitka (master)Nuitka (develop)Nuitka (factory)2891570473.61538461538461257.0CPython 3.50196.30769230769232504.11538461538464Nuitka (historic)5160685319.0000000000001460.0118532383223Nuitka (master)5161677441.69230769230774460.0033755453172Nuitka (develop)5150714564.3846153846155460.0970660175097Nuitka (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
156     PyObject *exception_keeper_type_1; 156     PyObject *exception_keeper_type_1;
157     PyObject *exception_keeper_value_1; 157     PyObject *exception_keeper_value_1;
158     PyTracebackObject *exception_keeper_tb_1; 158     PyTracebackObject *exception_keeper_tb_1;
159     NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1; 159     NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1;
160     PyObject *tmp_assign_source_1; 160     PyObject *tmp_assign_source_1;
n 161     PyObject *tmp_called_name_1; n
162     PyObject *tmp_return_value; 161     PyObject *tmp_return_value;
n 163     NUITKA_MAY_BE_UNUSED PyObject *tmp_unused; n
164     static struct Nuitka_FrameObject *cache_frame_7747fa66d7db0c5abc92d5e2d53481ac = NULL; 162     static struct Nuitka_FrameObject *cache_frame_7747fa66d7db0c5abc92d5e2d53481ac = NULL;
165 163
166     struct Nuitka_FrameObject *frame_7747fa66d7db0c5abc92d5e2d53481ac; 164     struct Nuitka_FrameObject *frame_7747fa66d7db0c5abc92d5e2d53481ac;
167 165
168     char const *type_description; 166     char const *type_description;
204 202
205     assert( var_called == NULL ); 203     assert( var_called == NULL );
206     Py_INCREF( tmp_assign_source_1 ); 204     Py_INCREF( tmp_assign_source_1 );
207     var_called = tmp_assign_source_1; 205     var_called = tmp_assign_source_1;
208 206
n 209     tmp_called_name_1 = var_called; n
210  
211     CHECK_OBJECT( tmp_called_name_1 );
212     frame_7747fa66d7db0c5abc92d5e2d53481ac->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 207
227 #if 0 208 #if 0
228     RESTORE_FRAME_EXCEPTION( frame_7747fa66d7db0c5abc92d5e2d53481ac ); 209     RESTORE_FRAME_EXCEPTION( frame_7747fa66d7db0c5abc92d5e2d53481ac );
229 #endif 210 #endif
230 211
274     // tried codes exits in all cases 255     // tried codes exits in all cases
275     NUITKA_CANNOT_GET_HERE( __main__$$$function_2_calledRepeatedly ); 256     NUITKA_CANNOT_GET_HERE( __main__$$$function_2_calledRepeatedly );
276     return NULL; 257     return NULL;
277     // Return handler code: 258     // Return handler code:
278     try_return_handler_1:; 259     try_return_handler_1:;
n n 260     CHECK_OBJECT( (PyObject *)var_called );
279     Py_XDECREF( var_called ); 261     Py_DECREF( var_called );
280     var_called = NULL; 262     var_called = NULL;
281 263
282     goto function_return_exit; 264     goto function_return_exit;
283     // Exception handler code: 265     // Exception handler code:
284     try_except_handler_1:; 266     try_except_handler_1:;
288     exception_keeper_lineno_1 = exception_lineno; 270     exception_keeper_lineno_1 = exception_lineno;
289     exception_type = NULL; 271     exception_type = NULL;
290     exception_value = NULL; 272     exception_value = NULL;
291     exception_tb = NULL; 273     exception_tb = NULL;
292     exception_lineno = -1; 274     exception_lineno = -1;
t 293   t
294     Py_XDECREF( var_called );
295     var_called = NULL;
296 275
297     // Re-raise. 276     // Re-raise.
298     exception_type = exception_keeper_type_1; 277     exception_type = exception_keeper_type_1;
299     exception_value = exception_keeper_value_1; 278     exception_value = exception_keeper_value_1;
300     exception_tb = exception_keeper_tb_1; 279     exception_tb = exception_keeper_tb_1;