Construct CallCompiledObjectMethodPosArgsVariable

Performance Diagrams

Construct CallCompiledObjectMethodPosArgsVariable 002000000020000000400000004000000060000000600000008000000080000000100000000100000000120000000120000000140000000140000000160000000160000000180000000180000000200000000200000000220000000220000000240000000240000000260000000260000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)26138206488.11538461538461257.0CPython 2.786651257240.03846153846155422.19370118663363Nuitka (master)86651187391.96153846153845422.1937673659141Nuitka (develop)86501114543.8846153846154422.335649125312Nuitka (factory)Construct CallCompiledObjectMethodPosArgsVariableTicks Construct CallCompiledObjectMethodPosArgsVariable 002000000020000000400000004000000060000000600000008000000080000000100000000100000000120000000120000000140000000140000000160000000160000000180000000180000000200000000200000000220000000220000000240000000240000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)24367365488.11538461538461257.0CPython 3.589102604240.03846153846155413.75426474769347Nuitka (master)89102757391.96153846153845413.75410958666873Nuitka (develop)88952648543.8846153846154413.9063387778854Nuitka (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
608             goto frame_exception_exit_1; 608             goto frame_exception_exit_1;
609         } 609         }
610         assert(var_inst == NULL); 610         assert(var_inst == NULL);
611         var_inst = tmp_assign_source_7; 611         var_inst = tmp_assign_source_7;
612     } 612     }
n 613     { n
614         PyObject *tmp_called_instance_1;
615         PyObject *tmp_call_result_1;
616         PyObject *tmp_args_element_name_1;
617         PyObject *tmp_args_element_name_2;
618         PyObject *tmp_args_element_name_3;
619         PyObject *tmp_args_element_name_4;
620         PyObject *tmp_args_element_name_5;
621         PyObject *tmp_args_element_name_6;
622         CHECK_OBJECT(var_inst);
623         tmp_called_instance_1 = var_inst;
624         CHECK_OBJECT(var_a);
625         tmp_args_element_name_1 = var_a;
626         CHECK_OBJECT(var_b);
627         tmp_args_element_name_2 = var_b;
628         CHECK_OBJECT(var_c);
629         tmp_args_element_name_3 = var_c;
630         CHECK_OBJECT(var_d);
631         tmp_args_element_name_4 = var_d;
632         CHECK_OBJECT(var_e);
633         tmp_args_element_name_5 = var_e;
634         CHECK_OBJECT(var_f);
635         tmp_args_element_name_6 = var_f;
636         frame_abfc1b1def47b1632a379312710c8768->m_frame.f_lineno = 42;
637         {
638             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 };
639             tmp_call_result_1 = CALL_METHOD_WITH_ARGS6(tmp_called_instance_1, const_str_plain_compiled_method, call_args);
640         }
641  
642         if (tmp_call_result_1 == NULL) {
643             assert(ERROR_OCCURRED());
644  
645             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
646  
647  
648             exception_lineno = 42;
649             type_description_1 = "ooooooo";
650             goto frame_exception_exit_1;
651         }
652         Py_DECREF(tmp_call_result_1);
653     }
654     {
655         PyObject *tmp_called_instance_2;
656         PyObject *tmp_call_result_2;
657         PyObject *tmp_args_element_name_7;
658         PyObject *tmp_args_element_name_8;
659         PyObject *tmp_args_element_name_9;
660         PyObject *tmp_args_element_name_10;
661         PyObject *tmp_args_element_name_11;
662         PyObject *tmp_args_element_name_12;
663         CHECK_OBJECT(var_inst);
664         tmp_called_instance_2 = var_inst;
665         CHECK_OBJECT(var_a);
666         tmp_args_element_name_7 = var_a;
667         CHECK_OBJECT(var_c);
668         tmp_args_element_name_8 = var_c;
669         CHECK_OBJECT(var_b);
670         tmp_args_element_name_9 = var_b;
671         CHECK_OBJECT(var_d);
672         tmp_args_element_name_10 = var_d;
673         CHECK_OBJECT(var_e);
674         tmp_args_element_name_11 = var_e;
675         CHECK_OBJECT(var_f);
676         tmp_args_element_name_12 = var_f;
677         frame_abfc1b1def47b1632a379312710c8768->m_frame.f_lineno = 43;
678         {
679             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 };
680             tmp_call_result_2 = CALL_METHOD_WITH_ARGS6(tmp_called_instance_2, const_str_plain_compiled_method, call_args);
681         }
682  
683         if (tmp_call_result_2 == NULL) {
684             assert(ERROR_OCCURRED());
685  
686             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
687  
688  
689             exception_lineno = 43;
690             type_description_1 = "ooooooo";
691             goto frame_exception_exit_1;
692         }
693         Py_DECREF(tmp_call_result_2);
694     }
695     {
696         PyObject *tmp_called_instance_3;
697         PyObject *tmp_call_result_3;
698         PyObject *tmp_args_element_name_13;
699         PyObject *tmp_args_element_name_14;
700         PyObject *tmp_args_element_name_15;
701         PyObject *tmp_args_element_name_16;
702         PyObject *tmp_args_element_name_17;
703         PyObject *tmp_args_element_name_18;
704         CHECK_OBJECT(var_inst);
705         tmp_called_instance_3 = var_inst;
706         CHECK_OBJECT(var_a);
707         tmp_args_element_name_13 = var_a;
708         CHECK_OBJECT(var_b);
709         tmp_args_element_name_14 = var_b;
710         CHECK_OBJECT(var_c);
711         tmp_args_element_name_15 = var_c;
712         CHECK_OBJECT(var_d);
713         tmp_args_element_name_16 = var_d;
714         CHECK_OBJECT(var_f);
715         tmp_args_element_name_17 = var_f;
716         CHECK_OBJECT(var_e);
717         tmp_args_element_name_18 = var_e;
718         frame_abfc1b1def47b1632a379312710c8768->m_frame.f_lineno = 44;
719         {
720             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 };
721             tmp_call_result_3 = CALL_METHOD_WITH_ARGS6(tmp_called_instance_3, const_str_plain_compiled_method, call_args);
722         }
723  
724         if (tmp_call_result_3 == NULL) {
725             assert(ERROR_OCCURRED());
726  
727             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
728  
729  
730             exception_lineno = 44;
731             type_description_1 = "ooooooo";
732             goto frame_exception_exit_1;
733         }
734         Py_DECREF(tmp_call_result_3);
735     }
736 613
737 #if 0 614 #if 0
738     RESTORE_FRAME_EXCEPTION(frame_abfc1b1def47b1632a379312710c8768); 615     RESTORE_FRAME_EXCEPTION(frame_abfc1b1def47b1632a379312710c8768);
739 #endif 616 #endif
740 617
830     exception_keeper_lineno_1 = exception_lineno; 707     exception_keeper_lineno_1 = exception_lineno;
831     exception_type = NULL; 708     exception_type = NULL;
832     exception_value = NULL; 709     exception_value = NULL;
833     exception_tb = NULL; 710     exception_tb = NULL;
834     exception_lineno = 0; 711     exception_lineno = 0;
t 835   t
836     Py_XDECREF(var_inst);
837     var_inst = NULL;
838 712
839     Py_XDECREF(var_b); 713     Py_XDECREF(var_b);
840     var_b = NULL; 714     var_b = NULL;
841 715
842     Py_XDECREF(var_c); 716     Py_XDECREF(var_c);