Construct CallCompiledObjectMethodPosArgsVariable

Performance Diagrams

Construct CallCompiledObjectMethodPosArgsVariable 002000000020000000400000004000000060000000600000008000000080000000100000000100000000120000000120000000140000000140000000160000000160000000180000000180000000200000000200000000220000000220000000240000000240000000260000000260000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)27697144888.11538461538461257.0CPython 2.789802110240.03846153846155423.99346911771545Nuitka (master)88901888391.96153846153845424.7966519272635Nuitka (develop)88900797543.8846153846154424.7976253232094Nuitka (factory)Construct CallCompiledObjectMethodPosArgsVariableTicks Construct CallCompiledObjectMethodPosArgsVariable 002000000020000000400000004000000060000000600000008000000080000000100000000100000000120000000120000000140000000140000000160000000160000000180000000180000000200000000200000000220000000220000000240000000240000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)25731160388.11538461538461257.0CPython 3.598851257240.03846153846155409.18120322415825Nuitka (master)88006956391.96153846153845419.5957884245777Nuitka (develop)88006693543.8846153846154419.5960410029511Nuitka (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
673     } 673     }
674     assert( var_inst == NULL ); 674     assert( var_inst == NULL );
675     var_inst = tmp_assign_source_7; 675     var_inst = tmp_assign_source_7;
676 676
677     } 677     }
n 678     { n
679     PyObject *tmp_called_instance_1;
680     PyObject *tmp_call_result_1;
681     PyObject *tmp_args_element_name_1;
682     PyObject *tmp_args_element_name_2;
683     PyObject *tmp_args_element_name_3;
684     PyObject *tmp_args_element_name_4;
685     PyObject *tmp_args_element_name_5;
686     PyObject *tmp_args_element_name_6;
687     CHECK_OBJECT( var_inst );
688     tmp_called_instance_1 = var_inst;
689     CHECK_OBJECT( var_a );
690     tmp_args_element_name_1 = var_a;
691     CHECK_OBJECT( var_b );
692     tmp_args_element_name_2 = var_b;
693     CHECK_OBJECT( var_c );
694     tmp_args_element_name_3 = var_c;
695     CHECK_OBJECT( var_d );
696     tmp_args_element_name_4 = var_d;
697     CHECK_OBJECT( var_e );
698     tmp_args_element_name_5 = var_e;
699     CHECK_OBJECT( var_f );
700     tmp_args_element_name_6 = var_f;
701     frame_3b99296fb2e447236858792f36aeb423->m_frame.f_lineno = 42;
702     {
703         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 };
704         tmp_call_result_1 = CALL_METHOD_WITH_ARGS6( tmp_called_instance_1, const_str_plain_compiled_method, call_args );
705     }
706  
707     if ( tmp_call_result_1 == NULL )
708     {
709         assert( ERROR_OCCURRED() );
710  
711         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
712  
713  
714         exception_lineno = 42;
715         type_description_1 = "ooooooo";
716         goto frame_exception_exit_1;
717     }
718     Py_DECREF( tmp_call_result_1 );
719     }
720     {
721     PyObject *tmp_called_instance_2;
722     PyObject *tmp_call_result_2;
723     PyObject *tmp_args_element_name_7;
724     PyObject *tmp_args_element_name_8;
725     PyObject *tmp_args_element_name_9;
726     PyObject *tmp_args_element_name_10;
727     PyObject *tmp_args_element_name_11;
728     PyObject *tmp_args_element_name_12;
729     CHECK_OBJECT( var_inst );
730     tmp_called_instance_2 = var_inst;
731     CHECK_OBJECT( var_a );
732     tmp_args_element_name_7 = var_a;
733     CHECK_OBJECT( var_c );
734     tmp_args_element_name_8 = var_c;
735     CHECK_OBJECT( var_b );
736     tmp_args_element_name_9 = var_b;
737     CHECK_OBJECT( var_d );
738     tmp_args_element_name_10 = var_d;
739     CHECK_OBJECT( var_e );
740     tmp_args_element_name_11 = var_e;
741     CHECK_OBJECT( var_f );
742     tmp_args_element_name_12 = var_f;
743     frame_3b99296fb2e447236858792f36aeb423->m_frame.f_lineno = 43;
744     {
745         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 };
746         tmp_call_result_2 = CALL_METHOD_WITH_ARGS6( tmp_called_instance_2, const_str_plain_compiled_method, call_args );
747     }
748  
749     if ( tmp_call_result_2 == NULL )
750     {
751         assert( ERROR_OCCURRED() );
752  
753         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
754  
755  
756         exception_lineno = 43;
757         type_description_1 = "ooooooo";
758         goto frame_exception_exit_1;
759     }
760     Py_DECREF( tmp_call_result_2 );
761     }
762     {
763     PyObject *tmp_called_instance_3;
764     PyObject *tmp_call_result_3;
765     PyObject *tmp_args_element_name_13;
766     PyObject *tmp_args_element_name_14;
767     PyObject *tmp_args_element_name_15;
768     PyObject *tmp_args_element_name_16;
769     PyObject *tmp_args_element_name_17;
770     PyObject *tmp_args_element_name_18;
771     CHECK_OBJECT( var_inst );
772     tmp_called_instance_3 = var_inst;
773     CHECK_OBJECT( var_a );
774     tmp_args_element_name_13 = var_a;
775     CHECK_OBJECT( var_b );
776     tmp_args_element_name_14 = var_b;
777     CHECK_OBJECT( var_c );
778     tmp_args_element_name_15 = var_c;
779     CHECK_OBJECT( var_d );
780     tmp_args_element_name_16 = var_d;
781     CHECK_OBJECT( var_f );
782     tmp_args_element_name_17 = var_f;
783     CHECK_OBJECT( var_e );
784     tmp_args_element_name_18 = var_e;
785     frame_3b99296fb2e447236858792f36aeb423->m_frame.f_lineno = 44;
786     {
787         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 };
788         tmp_call_result_3 = CALL_METHOD_WITH_ARGS6( tmp_called_instance_3, const_str_plain_compiled_method, call_args );
789     }
790  
791     if ( tmp_call_result_3 == NULL )
792     {
793         assert( ERROR_OCCURRED() );
794  
795         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
796  
797  
798         exception_lineno = 44;
799         type_description_1 = "ooooooo";
800         goto frame_exception_exit_1;
801     }
802     Py_DECREF( tmp_call_result_3 );
803     }
804 678
805 #if 0 679 #if 0
806     RESTORE_FRAME_EXCEPTION( frame_3b99296fb2e447236858792f36aeb423 ); 680     RESTORE_FRAME_EXCEPTION( frame_3b99296fb2e447236858792f36aeb423 );
807 #endif 681 #endif
808 682
920     exception_type = NULL; 794     exception_type = NULL;
921     exception_value = NULL; 795     exception_value = NULL;
922     exception_tb = NULL; 796     exception_tb = NULL;
923     exception_lineno = 0; 797     exception_lineno = 0;
924 798
t 925     { t
926     Py_XDECREF( var_inst );
927     var_inst = NULL;
928  
929     }
930     { 799     {
931     Py_XDECREF( var_b ); 800     Py_XDECREF( var_b );
932     var_b = NULL; 801     var_b = NULL;
933 802
934     } 803     }