Construct CallCompiledObjectMethodNoArgs

Performance Diagrams

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