Construct CallCompiledFunctionPosArgsVariable

Performance Diagrams

Construct CallCompiledFunctionPosArgsVariable 002000000020000000400000004000000060000000600000008000000080000000100000000100000000120000000120000000140000000140000000160000000160000000180000000180000000200000000200000000220000000220000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)23763997088.11538461538461257.0CPython 2.761100030240.03846153846155440.57911412409675Nuitka (master)61100048391.96153846153845440.57909540638303Nuitka (develop)61099162543.8846153846154440.5800167338465Nuitka (factory)Construct CallCompiledFunctionPosArgsVariableTicks Construct CallCompiledFunctionPosArgsVariable 002000000020000000400000004000000060000000600000008000000080000000100000000100000000120000000120000000140000000140000000160000000160000000180000000180000000200000000200000000220000000220000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)22474765588.11538461538461257.0CPython 3.568798831240.03846153846155428.46943590168684Nuitka (master)68786545391.96153846153845428.4829446504895Nuitka (develop)68799197543.8846153846154428.469033475994Nuitka (factory)Construct CallCompiledFunctionPosArgsVariableTicks

Source Code with Construct

from __future__ import print_function

def compiled_func(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()

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

def compiled_func(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()

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

Context Diff of Generated Code


Construct
Baseline
574             goto frame_exception_exit_1; 574             goto frame_exception_exit_1;
575         } 575         }
576         assert( var_f == NULL ); 576         assert( var_f == NULL );
577         var_f = tmp_assign_source_6; 577         var_f = tmp_assign_source_6;
578     } 578     }
n 579     { n
580         PyObject *tmp_called_name_7;
581         PyObject *tmp_mvar_value_7;
582         PyObject *tmp_call_result_1;
583         PyObject *tmp_args_element_name_1;
584         PyObject *tmp_args_element_name_2;
585         PyObject *tmp_args_element_name_3;
586         PyObject *tmp_args_element_name_4;
587         PyObject *tmp_args_element_name_5;
588         PyObject *tmp_args_element_name_6;
589         tmp_mvar_value_7 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_compiled_func );
590  
591         if (unlikely( tmp_mvar_value_7 == NULL ))
592         {
593             tmp_mvar_value_7 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_compiled_func );
594         }
595  
596         if ( tmp_mvar_value_7 == NULL )
597         {
598  
599             exception_type = PyExc_NameError;
600             Py_INCREF( exception_type );
601             exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "compiled_func" );
602             exception_tb = NULL;
603             NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
604             CHAIN_EXCEPTION( exception_value );
605  
606             exception_lineno = 39;
607             type_description_1 = "oooooo";
608             goto frame_exception_exit_1;
609         }
610  
611         tmp_called_name_7 = tmp_mvar_value_7;
612         CHECK_OBJECT( var_a );
613         tmp_args_element_name_1 = var_a;
614         CHECK_OBJECT( var_b );
615         tmp_args_element_name_2 = var_b;
616         CHECK_OBJECT( var_c );
617         tmp_args_element_name_3 = var_c;
618         CHECK_OBJECT( var_d );
619         tmp_args_element_name_4 = var_d;
620         CHECK_OBJECT( var_e );
621         tmp_args_element_name_5 = var_e;
622         CHECK_OBJECT( var_f );
623         tmp_args_element_name_6 = var_f;
624         frame_3b7e476dba90754198daa152ff253c36->m_frame.f_lineno = 39;
625         {
626             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 };
627             tmp_call_result_1 = CALL_FUNCTION_WITH_ARGS6( tmp_called_name_7, call_args );
628         }
629  
630         if ( tmp_call_result_1 == NULL )
631         {
632             assert( ERROR_OCCURRED() );
633  
634             FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
635  
636  
637             exception_lineno = 39;
638             type_description_1 = "oooooo";
639             goto frame_exception_exit_1;
640         }
641         Py_DECREF( tmp_call_result_1 );
642     }
643     {
644         PyObject *tmp_called_name_8;
645         PyObject *tmp_mvar_value_8;
646         PyObject *tmp_call_result_2;
647         PyObject *tmp_args_element_name_7;
648         PyObject *tmp_args_element_name_8;
649         PyObject *tmp_args_element_name_9;
650         PyObject *tmp_args_element_name_10;
651         PyObject *tmp_args_element_name_11;
652         PyObject *tmp_args_element_name_12;
653         tmp_mvar_value_8 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_compiled_func );
654  
655         if (unlikely( tmp_mvar_value_8 == NULL ))
656         {
657             tmp_mvar_value_8 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_compiled_func );
658         }
659  
660         if ( tmp_mvar_value_8 == NULL )
661         {
662  
663             exception_type = PyExc_NameError;
664             Py_INCREF( exception_type );
665             exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "compiled_func" );
666             exception_tb = NULL;
667             NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
668             CHAIN_EXCEPTION( exception_value );
669  
670             exception_lineno = 40;
671             type_description_1 = "oooooo";
672             goto frame_exception_exit_1;
673         }
674  
675         tmp_called_name_8 = tmp_mvar_value_8;
676         CHECK_OBJECT( var_a );
677         tmp_args_element_name_7 = var_a;
678         CHECK_OBJECT( var_c );
679         tmp_args_element_name_8 = var_c;
680         CHECK_OBJECT( var_b );
681         tmp_args_element_name_9 = var_b;
682         CHECK_OBJECT( var_d );
683         tmp_args_element_name_10 = var_d;
684         CHECK_OBJECT( var_e );
685         tmp_args_element_name_11 = var_e;
686         CHECK_OBJECT( var_f );
687         tmp_args_element_name_12 = var_f;
688         frame_3b7e476dba90754198daa152ff253c36->m_frame.f_lineno = 40;
689         {
690             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 };
691             tmp_call_result_2 = CALL_FUNCTION_WITH_ARGS6( tmp_called_name_8, call_args );
692         }
693  
694         if ( tmp_call_result_2 == NULL )
695         {
696             assert( ERROR_OCCURRED() );
697  
698             FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
699  
700  
701             exception_lineno = 40;
702             type_description_1 = "oooooo";
703             goto frame_exception_exit_1;
704         }
705         Py_DECREF( tmp_call_result_2 );
706     }
707     {
708         PyObject *tmp_called_name_9;
709         PyObject *tmp_mvar_value_9;
710         PyObject *tmp_call_result_3;
711         PyObject *tmp_args_element_name_13;
712         PyObject *tmp_args_element_name_14;
713         PyObject *tmp_args_element_name_15;
714         PyObject *tmp_args_element_name_16;
715         PyObject *tmp_args_element_name_17;
716         PyObject *tmp_args_element_name_18;
717         tmp_mvar_value_9 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_compiled_func );
718  
719         if (unlikely( tmp_mvar_value_9 == NULL ))
720         {
721             tmp_mvar_value_9 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_compiled_func );
722         }
723  
724         if ( tmp_mvar_value_9 == NULL )
725         {
726  
727             exception_type = PyExc_NameError;
728             Py_INCREF( exception_type );
729             exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "compiled_func" );
730             exception_tb = NULL;
731             NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
732             CHAIN_EXCEPTION( exception_value );
733  
734             exception_lineno = 41;
735             type_description_1 = "oooooo";
736             goto frame_exception_exit_1;
737         }
738  
739         tmp_called_name_9 = tmp_mvar_value_9;
740         CHECK_OBJECT( var_a );
741         tmp_args_element_name_13 = var_a;
742         CHECK_OBJECT( var_b );
743         tmp_args_element_name_14 = var_b;
744         CHECK_OBJECT( var_c );
745         tmp_args_element_name_15 = var_c;
746         CHECK_OBJECT( var_d );
747         tmp_args_element_name_16 = var_d;
748         CHECK_OBJECT( var_f );
749         tmp_args_element_name_17 = var_f;
750         CHECK_OBJECT( var_e );
751         tmp_args_element_name_18 = var_e;
752         frame_3b7e476dba90754198daa152ff253c36->m_frame.f_lineno = 41;
753         {
754             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 };
755             tmp_call_result_3 = CALL_FUNCTION_WITH_ARGS6( tmp_called_name_9, call_args );
756         }
757  
758         if ( tmp_call_result_3 == NULL )
759         {
760             assert( ERROR_OCCURRED() );
761  
762             FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
763  
764  
765             exception_lineno = 41;
766             type_description_1 = "oooooo";
767             goto frame_exception_exit_1;
768         }
769         Py_DECREF( tmp_call_result_3 );
770     }
771 579
772 #if 0 580 #if 0
773     RESTORE_FRAME_EXCEPTION( frame_3b7e476dba90754198daa152ff253c36 ); 581     RESTORE_FRAME_EXCEPTION( frame_3b7e476dba90754198daa152ff253c36 );
774 #endif 582 #endif
775 583
875     Py_XDECREF( var_e ); 683     Py_XDECREF( var_e );
876     var_e = NULL; 684     var_e = NULL;
877 685
878     Py_XDECREF( var_a ); 686     Py_XDECREF( var_a );
879     var_a = NULL; 687     var_a = NULL;
t 880   t
881     Py_XDECREF( var_f );
882     var_f = NULL;
883 688
884     Py_XDECREF( var_d ); 689     Py_XDECREF( var_d );
885     var_d = NULL; 690     var_d = NULL;
886 691
887     // Re-raise. 692     // Re-raise.