Construct CallCompiledObjectMethodPosArgsVariable

Performance Diagrams

Construct CallCompiledObjectMethodPosArgsVariable 002000000020000000400000004000000060000000600000008000000080000000100000000100000000120000000120000000140000000140000000160000000160000000180000000180000000200000000200000000220000000220000000240000000240000000260000000260000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)27546992088.11538461538461257.0CPython 2.788901104240.03846153846155424.3650056713158Nuitka (master)88901102391.96153846153845424.36500746545283Nuitka (develop)88901096543.8846153846154424.36501284786374Nuitka (factory)Construct CallCompiledObjectMethodPosArgsVariableTicks Construct CallCompiledObjectMethodPosArgsVariable 002000000020000000400000004000000060000000600000008000000080000000100000000100000000120000000120000000140000000140000000160000000160000000180000000180000000200000000200000000220000000220000000240000000240000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)25911165688.11538461538461257.0CPython 3.588006884240.03846153846155420.1830161369031Nuitka (master)88001858391.96153846153845420.18780944470814Nuitka (develop)88014978543.8846153846154420.1752968704141Nuitka (factory)Construct CallCompiledObjectMethodPosArgsVariableTicks

Source Code with Construct

from __future__ import print_function

class C(object):
    def compiled_method(self, a,b,c,d,e,f):
        return a, b, c, d, e, f

def getUnknownValue():
    return 8

def calledRepeatedly():
    a = getUnknownValue()
    b = getUnknownValue()
    c = getUnknownValue()
    d = getUnknownValue()
    e = getUnknownValue()
    f = getUnknownValue()

    inst = C()

    # This is supposed to make a call to a non-compiled function, which is
    # being optimized separately.
# construct_begin
    inst.compiled_method(a, b, c, d, e, f)
    inst.compiled_method(a, c, b, d, e, f)
    inst.compiled_method(a, b, c, d, f, e)
# 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, a,b,c,d,e,f):
        return a, b, c, d, e, f

def getUnknownValue():
    return 8

def calledRepeatedly():
    a = getUnknownValue()
    b = getUnknownValue()
    c = getUnknownValue()
    d = getUnknownValue()
    e = getUnknownValue()
    f = getUnknownValue()

    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
37     inst = C() 37     inst = C()
38 38
39     # This is supposed to make a call to a non-compiled function, which is 39     # This is supposed to make a call to a non-compiled function, which is
40     # being optimized separately. 40     # being optimized separately.
41 # construct_begin 41 # construct_begin
n 42     inst.compiled_method(a, b, c, d, e, f) n
43     inst.compiled_method(a, c, b, d, e, f)
44     inst.compiled_method(a, b, c, d, f, e)
45 # construct_alternative
46 42
47 43
t t 44  
45 # construct_alternative
46     pass
47 # construct_end
48 48
49 import itertools 49 import itertools
50 for x in itertools.repeat(None, 50000): 50 for x in itertools.repeat(None, 50000):
51     calledRepeatedly() 51     calledRepeatedly()
52 52

Context Diff of Generated Code


Construct
Baseline
656             goto frame_exception_exit_1; 656             goto frame_exception_exit_1;
657         } 657         }
658         assert( var_inst == NULL ); 658         assert( var_inst == NULL );
659         var_inst = tmp_assign_source_7; 659         var_inst = tmp_assign_source_7;
660     } 660     }
n 661     { n
662         PyObject *tmp_called_instance_1;
663         PyObject *tmp_call_result_1;
664         PyObject *tmp_args_element_name_1;
665         PyObject *tmp_args_element_name_2;
666         PyObject *tmp_args_element_name_3;
667         PyObject *tmp_args_element_name_4;
668         PyObject *tmp_args_element_name_5;
669         PyObject *tmp_args_element_name_6;
670         CHECK_OBJECT( var_inst );
671         tmp_called_instance_1 = var_inst;
672         CHECK_OBJECT( var_a );
673         tmp_args_element_name_1 = var_a;
674         CHECK_OBJECT( var_b );
675         tmp_args_element_name_2 = var_b;
676         CHECK_OBJECT( var_c );
677         tmp_args_element_name_3 = var_c;
678         CHECK_OBJECT( var_d );
679         tmp_args_element_name_4 = var_d;
680         CHECK_OBJECT( var_e );
681         tmp_args_element_name_5 = var_e;
682         CHECK_OBJECT( var_f );
683         tmp_args_element_name_6 = var_f;
684         frame_1b191152474462e1e9ce2066fd08afe6->m_frame.f_lineno = 42;
685         {
686             PyObject *call_args[] = { tmp_args_element_name_1, tmp_args_element_name_2, tmp_args_element_name_3, tmp_args_element_name_4, tmp_args_element_name_5, tmp_args_element_name_6 };
687             tmp_call_result_1 = CALL_METHOD_WITH_ARGS6( tmp_called_instance_1, const_str_plain_compiled_method, call_args );
688         }
689  
690         if ( tmp_call_result_1 == NULL )
691         {
692             assert( ERROR_OCCURRED() );
693  
694             FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
695  
696  
697             exception_lineno = 42;
698             type_description_1 = "ooooooo";
699             goto frame_exception_exit_1;
700         }
701         Py_DECREF( tmp_call_result_1 );
702     }
703     {
704         PyObject *tmp_called_instance_2;
705         PyObject *tmp_call_result_2;
706         PyObject *tmp_args_element_name_7;
707         PyObject *tmp_args_element_name_8;
708         PyObject *tmp_args_element_name_9;
709         PyObject *tmp_args_element_name_10;
710         PyObject *tmp_args_element_name_11;
711         PyObject *tmp_args_element_name_12;
712         CHECK_OBJECT( var_inst );
713         tmp_called_instance_2 = var_inst;
714         CHECK_OBJECT( var_a );
715         tmp_args_element_name_7 = var_a;
716         CHECK_OBJECT( var_c );
717         tmp_args_element_name_8 = var_c;
718         CHECK_OBJECT( var_b );
719         tmp_args_element_name_9 = var_b;
720         CHECK_OBJECT( var_d );
721         tmp_args_element_name_10 = var_d;
722         CHECK_OBJECT( var_e );
723         tmp_args_element_name_11 = var_e;
724         CHECK_OBJECT( var_f );
725         tmp_args_element_name_12 = var_f;
726         frame_1b191152474462e1e9ce2066fd08afe6->m_frame.f_lineno = 43;
727         {
728             PyObject *call_args[] = { tmp_args_element_name_7, tmp_args_element_name_8, tmp_args_element_name_9, tmp_args_element_name_10, tmp_args_element_name_11, tmp_args_element_name_12 };
729             tmp_call_result_2 = CALL_METHOD_WITH_ARGS6( tmp_called_instance_2, const_str_plain_compiled_method, call_args );
730         }
731  
732         if ( tmp_call_result_2 == NULL )
733         {
734             assert( ERROR_OCCURRED() );
735  
736             FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
737  
738  
739             exception_lineno = 43;
740             type_description_1 = "ooooooo";
741             goto frame_exception_exit_1;
742         }
743         Py_DECREF( tmp_call_result_2 );
744     }
745     {
746         PyObject *tmp_called_instance_3;
747         PyObject *tmp_call_result_3;
748         PyObject *tmp_args_element_name_13;
749         PyObject *tmp_args_element_name_14;
750         PyObject *tmp_args_element_name_15;
751         PyObject *tmp_args_element_name_16;
752         PyObject *tmp_args_element_name_17;
753         PyObject *tmp_args_element_name_18;
754         CHECK_OBJECT( var_inst );
755         tmp_called_instance_3 = var_inst;
756         CHECK_OBJECT( var_a );
757         tmp_args_element_name_13 = var_a;
758         CHECK_OBJECT( var_b );
759         tmp_args_element_name_14 = var_b;
760         CHECK_OBJECT( var_c );
761         tmp_args_element_name_15 = var_c;
762         CHECK_OBJECT( var_d );
763         tmp_args_element_name_16 = var_d;
764         CHECK_OBJECT( var_f );
765         tmp_args_element_name_17 = var_f;
766         CHECK_OBJECT( var_e );
767         tmp_args_element_name_18 = var_e;
768         frame_1b191152474462e1e9ce2066fd08afe6->m_frame.f_lineno = 44;
769         {
770             PyObject *call_args[] = { tmp_args_element_name_13, tmp_args_element_name_14, tmp_args_element_name_15, tmp_args_element_name_16, tmp_args_element_name_17, tmp_args_element_name_18 };
771             tmp_call_result_3 = CALL_METHOD_WITH_ARGS6( tmp_called_instance_3, const_str_plain_compiled_method, call_args );
772         }
773  
774         if ( tmp_call_result_3 == NULL )
775         {
776             assert( ERROR_OCCURRED() );
777  
778             FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
779  
780  
781             exception_lineno = 44;
782             type_description_1 = "ooooooo";
783             goto frame_exception_exit_1;
784         }
785         Py_DECREF( tmp_call_result_3 );
786     }
787 661
788 #if 0 662 #if 0
789     RESTORE_FRAME_EXCEPTION( frame_1b191152474462e1e9ce2066fd08afe6 ); 663     RESTORE_FRAME_EXCEPTION( frame_1b191152474462e1e9ce2066fd08afe6 );
790 #endif 664 #endif
791 665
884     exception_keeper_lineno_1 = exception_lineno; 758     exception_keeper_lineno_1 = exception_lineno;
885     exception_type = NULL; 759     exception_type = NULL;
886     exception_value = NULL; 760     exception_value = NULL;
887     exception_tb = NULL; 761     exception_tb = NULL;
888     exception_lineno = 0; 762     exception_lineno = 0;
t 889   t
890     Py_XDECREF( var_inst );
891     var_inst = NULL;
892 763
893     Py_XDECREF( var_b ); 764     Py_XDECREF( var_b );
894     var_b = NULL; 765     var_b = NULL;
895 766
896     Py_XDECREF( var_c ); 767     Py_XDECREF( var_c );