Construct CallCompiledObjectMethodNoArgs

Performance Diagrams

Construct CallCompiledObjectMethodNoArgs 00100000001000000020000000200000003000000030000000400000004000000050000000500000006000000060000000700000007000000080000000800000009000000090000000100000000100000000110000000110000000120000000120000000130000000130000000140000000140000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)14268001088.11538461538461257.0CPython 2.728601344240.03846153846155454.57913827592245Nuitka (master)28601416391.96153846153845454.5790135751484Nuitka (develop)28601386543.8846153846154454.5790655338043Nuitka (factory)Construct CallCompiledObjectMethodNoArgsTicks Construct CallCompiledObjectMethodNoArgs 00100000001000000020000000200000003000000030000000400000004000000050000000500000006000000060000000700000007000000080000000800000009000000090000000100000000100000000110000000110000000120000000120000000130000000130000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)13370790188.11538461538461257.00000000000006CPython 3.529306932240.03846153846155449.9510927604334Nuitka (master)29301988391.96153846153845449.9602301296719Nuitka (develop)29302052543.8846153846154449.96011184657493Nuitka (factory)Construct CallCompiledObjectMethodNoArgsTicks

Source Code with Construct

from __future__ import print_function

class C(object):
    def compiled_method(self):
        return self

def calledRepeatedly():
    inst = C()

    # This is supposed to make a call to a non-compiled function, which is
    # being optimized separately.
# construct_begin
    inst.compiled_method()
    inst.compiled_method()
    inst.compiled_method()

# construct_alternative



import itertools
for x in itertools.repeat(None, 50000):
    calledRepeatedly()

print("OK.")

Source Code without Construct

from __future__ import print_function

class C(object):
    def compiled_method(self):
        return self

def calledRepeatedly():
    inst = C()

    # This is supposed to make a call to a non-compiled function, which is
    # being optimized separately.
# construct_begin




# construct_alternative
    pass
# construct_end

import itertools
for x in itertools.repeat(None, 50000):
    calledRepeatedly()

print("OK.")

Context Diff of Source Code


Construct
Baseline
27     inst = C() 27     inst = C()
28 28
29     # This is supposed to make a call to a non-compiled function, which is 29     # This is supposed to make a call to a non-compiled function, which is
30     # being optimized separately. 30     # being optimized separately.
31 # construct_begin 31 # construct_begin
n 32     inst.compiled_method() n 32  
33     inst.compiled_method() 33  
34     inst.compiled_method() 34  
35 35
36 # construct_alternative 36 # construct_alternative
t 37   t 37     pass
38   38 # construct_end
39 39
40 import itertools 40 import itertools
41 for x in itertools.repeat(None, 50000): 41 for x in itertools.repeat(None, 50000):
42     calledRepeatedly() 42     calledRepeatedly()
43 43

Context Diff of Generated Code


Construct
Baseline
271             goto frame_exception_exit_1; 271             goto frame_exception_exit_1;
272         } 272         }
273         assert( var_inst == NULL ); 273         assert( var_inst == NULL );
274         var_inst = tmp_assign_source_1; 274         var_inst = tmp_assign_source_1;
275     } 275     }
n 276     { n
277         PyObject *tmp_called_instance_1;
278         PyObject *tmp_call_result_1;
279         CHECK_OBJECT( var_inst );
280         tmp_called_instance_1 = var_inst;
281         frame_14e2fb49c53fd26a8d26d9665c9289f6->m_frame.f_lineno = 32;
282         tmp_call_result_1 = CALL_METHOD_NO_ARGS( tmp_called_instance_1, const_str_plain_compiled_method );
283         if ( tmp_call_result_1 == NULL )
284         {
285             assert( ERROR_OCCURRED() );
286  
287             FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
288  
289  
290             exception_lineno = 32;
291             type_description_1 = "o";
292             goto frame_exception_exit_1;
293         }
294         Py_DECREF( tmp_call_result_1 );
295     }
296     {
297         PyObject *tmp_called_instance_2;
298         PyObject *tmp_call_result_2;
299         CHECK_OBJECT( var_inst );
300         tmp_called_instance_2 = var_inst;
301         frame_14e2fb49c53fd26a8d26d9665c9289f6->m_frame.f_lineno = 33;
302         tmp_call_result_2 = CALL_METHOD_NO_ARGS( tmp_called_instance_2, const_str_plain_compiled_method );
303         if ( tmp_call_result_2 == NULL )
304         {
305             assert( ERROR_OCCURRED() );
306  
307             FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
308  
309  
310             exception_lineno = 33;
311             type_description_1 = "o";
312             goto frame_exception_exit_1;
313         }
314         Py_DECREF( tmp_call_result_2 );
315     }
316     {
317         PyObject *tmp_called_instance_3;
318         PyObject *tmp_call_result_3;
319         CHECK_OBJECT( var_inst );
320         tmp_called_instance_3 = var_inst;
321         frame_14e2fb49c53fd26a8d26d9665c9289f6->m_frame.f_lineno = 34;
322         tmp_call_result_3 = CALL_METHOD_NO_ARGS( tmp_called_instance_3, const_str_plain_compiled_method );
323         if ( tmp_call_result_3 == NULL )
324         {
325             assert( ERROR_OCCURRED() );
326  
327             FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
328  
329  
330             exception_lineno = 34;
331             type_description_1 = "o";
332             goto frame_exception_exit_1;
333         }
334         Py_DECREF( tmp_call_result_3 );
335     }
336 276
337 #if 0 277 #if 0
338     RESTORE_FRAME_EXCEPTION( frame_14e2fb49c53fd26a8d26d9665c9289f6 ); 278     RESTORE_FRAME_EXCEPTION( frame_14e2fb49c53fd26a8d26d9665c9289f6 );
339 #endif 279 #endif
340 280
403     exception_keeper_lineno_1 = exception_lineno; 343     exception_keeper_lineno_1 = exception_lineno;
404     exception_type = NULL; 344     exception_type = NULL;
405     exception_value = NULL; 345     exception_value = NULL;
406     exception_tb = NULL; 346     exception_tb = NULL;
407     exception_lineno = 0; 347     exception_lineno = 0;
t 408   t
409     Py_XDECREF( var_inst );
410     var_inst = NULL;
411 348
412     // Re-raise. 349     // Re-raise.
413     exception_type = exception_keeper_type_1; 350     exception_type = exception_keeper_type_1;
414     exception_value = exception_keeper_value_1; 351     exception_value = exception_keeper_value_1;
415     exception_tb = exception_keeper_tb_1; 352     exception_tb = exception_keeper_tb_1;