Construct CallCompiledFunctionPosArgsVariable

Performance Diagrams

Construct CallCompiledFunctionPosArgsVariable 002000000020000000400000004000000060000000600000008000000080000000100000000100000000120000000120000000140000000140000000160000000160000000180000000180000000200000000200000000220000000220000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)23943977888.11538461538461257.0CPython 2.761100348240.03846153846155441.05637193891175Nuitka (master)61100264391.96153846153845441.05645863165967Nuitka (develop)61100300543.8846153846154441.05642147762484Nuitka (factory)Construct CallCompiledFunctionPosArgsVariableTicks Construct CallCompiledFunctionPosArgsVariable 002000000020000000400000004000000060000000600000008000000080000000100000000100000000120000000120000000140000000140000000160000000160000000180000000180000000200000000200000000220000000220000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)22295084688.11538461538461257.0CPython 3.569249861240.03846153846155427.35987396091093Nuitka (master)69249893391.96153846153845427.35983849258935Nuitka (develop)69250201543.8846153846154427.35949710999387Nuitka (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
583     } 583     }
584     assert( var_f == NULL ); 584     assert( var_f == NULL );
585     var_f = tmp_assign_source_6; 585     var_f = tmp_assign_source_6;
586 586
587     } 587     }
n 588     { n
589     PyObject *tmp_called_name_7;
590     PyObject *tmp_mvar_value_7;
591     PyObject *tmp_call_result_1;
592     PyObject *tmp_args_element_name_1;
593     PyObject *tmp_args_element_name_2;
594     PyObject *tmp_args_element_name_3;
595     PyObject *tmp_args_element_name_4;
596     PyObject *tmp_args_element_name_5;
597     PyObject *tmp_args_element_name_6;
598     tmp_mvar_value_7 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_compiled_func );
599  
600     if (unlikely( tmp_mvar_value_7 == NULL ))
601     {
602         tmp_mvar_value_7 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_compiled_func );
603     }
604  
605     if ( tmp_mvar_value_7 == NULL )
606     {
607  
608         exception_type = PyExc_NameError;
609         Py_INCREF( exception_type );
610         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "compiled_func" );
611         exception_tb = NULL;
612         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
613         CHAIN_EXCEPTION( exception_value );
614  
615         exception_lineno = 39;
616         type_description_1 = "oooooo";
617         goto frame_exception_exit_1;
618     }
619  
620     tmp_called_name_7 = tmp_mvar_value_7;
621     if ( var_a == NULL )
622     {
623  
624         exception_type = PyExc_UnboundLocalError;
625         Py_INCREF( exception_type );
626         exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "a" );
627         exception_tb = NULL;
628         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
629         CHAIN_EXCEPTION( exception_value );
630  
631         exception_lineno = 39;
632         type_description_1 = "oooooo";
633         goto frame_exception_exit_1;
634     }
635  
636     tmp_args_element_name_1 = var_a;
637     if ( var_b == NULL )
638     {
639  
640         exception_type = PyExc_UnboundLocalError;
641         Py_INCREF( exception_type );
642         exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "b" );
643         exception_tb = NULL;
644         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
645         CHAIN_EXCEPTION( exception_value );
646  
647         exception_lineno = 39;
648         type_description_1 = "oooooo";
649         goto frame_exception_exit_1;
650     }
651  
652     tmp_args_element_name_2 = var_b;
653     if ( var_c == NULL )
654     {
655  
656         exception_type = PyExc_UnboundLocalError;
657         Py_INCREF( exception_type );
658         exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "c" );
659         exception_tb = NULL;
660         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
661         CHAIN_EXCEPTION( exception_value );
662  
663         exception_lineno = 39;
664         type_description_1 = "oooooo";
665         goto frame_exception_exit_1;
666     }
667  
668     tmp_args_element_name_3 = var_c;
669     if ( var_d == NULL )
670     {
671  
672         exception_type = PyExc_UnboundLocalError;
673         Py_INCREF( exception_type );
674         exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "d" );
675         exception_tb = NULL;
676         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
677         CHAIN_EXCEPTION( exception_value );
678  
679         exception_lineno = 39;
680         type_description_1 = "oooooo";
681         goto frame_exception_exit_1;
682     }
683  
684     tmp_args_element_name_4 = var_d;
685     if ( var_e == NULL )
686     {
687  
688         exception_type = PyExc_UnboundLocalError;
689         Py_INCREF( exception_type );
690         exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "e" );
691         exception_tb = NULL;
692         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
693         CHAIN_EXCEPTION( exception_value );
694  
695         exception_lineno = 39;
696         type_description_1 = "oooooo";
697         goto frame_exception_exit_1;
698     }
699  
700     tmp_args_element_name_5 = var_e;
701     CHECK_OBJECT( var_f );
702     tmp_args_element_name_6 = var_f;
703     frame_2357e9a1a99cc780bad2dd3528b19359->m_frame.f_lineno = 39;
704     {
705         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 };
706         tmp_call_result_1 = CALL_FUNCTION_WITH_ARGS6( tmp_called_name_7, call_args );
707     }
708  
709     if ( tmp_call_result_1 == NULL )
710     {
711         assert( ERROR_OCCURRED() );
712  
713         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
714  
715  
716         exception_lineno = 39;
717         type_description_1 = "oooooo";
718         goto frame_exception_exit_1;
719     }
720     Py_DECREF( tmp_call_result_1 );
721     }
722     {
723     PyObject *tmp_called_name_8;
724     PyObject *tmp_mvar_value_8;
725     PyObject *tmp_call_result_2;
726     PyObject *tmp_args_element_name_7;
727     PyObject *tmp_args_element_name_8;
728     PyObject *tmp_args_element_name_9;
729     PyObject *tmp_args_element_name_10;
730     PyObject *tmp_args_element_name_11;
731     PyObject *tmp_args_element_name_12;
732     tmp_mvar_value_8 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_compiled_func );
733  
734     if (unlikely( tmp_mvar_value_8 == NULL ))
735     {
736         tmp_mvar_value_8 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_compiled_func );
737     }
738  
739     if ( tmp_mvar_value_8 == NULL )
740     {
741  
742         exception_type = PyExc_NameError;
743         Py_INCREF( exception_type );
744         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "compiled_func" );
745         exception_tb = NULL;
746         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
747         CHAIN_EXCEPTION( exception_value );
748  
749         exception_lineno = 40;
750         type_description_1 = "oooooo";
751         goto frame_exception_exit_1;
752     }
753  
754     tmp_called_name_8 = tmp_mvar_value_8;
755     if ( var_a == NULL )
756     {
757  
758         exception_type = PyExc_UnboundLocalError;
759         Py_INCREF( exception_type );
760         exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "a" );
761         exception_tb = NULL;
762         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
763         CHAIN_EXCEPTION( exception_value );
764  
765         exception_lineno = 40;
766         type_description_1 = "oooooo";
767         goto frame_exception_exit_1;
768     }
769  
770     tmp_args_element_name_7 = var_a;
771     if ( var_c == NULL )
772     {
773  
774         exception_type = PyExc_UnboundLocalError;
775         Py_INCREF( exception_type );
776         exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "c" );
777         exception_tb = NULL;
778         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
779         CHAIN_EXCEPTION( exception_value );
780  
781         exception_lineno = 40;
782         type_description_1 = "oooooo";
783         goto frame_exception_exit_1;
784     }
785  
786     tmp_args_element_name_8 = var_c;
787     if ( var_b == NULL )
788     {
789  
790         exception_type = PyExc_UnboundLocalError;
791         Py_INCREF( exception_type );
792         exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "b" );
793         exception_tb = NULL;
794         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
795         CHAIN_EXCEPTION( exception_value );
796  
797         exception_lineno = 40;
798         type_description_1 = "oooooo";
799         goto frame_exception_exit_1;
800     }
801  
802     tmp_args_element_name_9 = var_b;
803     if ( var_d == NULL )
804     {
805  
806         exception_type = PyExc_UnboundLocalError;
807         Py_INCREF( exception_type );
808         exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "d" );
809         exception_tb = NULL;
810         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
811         CHAIN_EXCEPTION( exception_value );
812  
813         exception_lineno = 40;
814         type_description_1 = "oooooo";
815         goto frame_exception_exit_1;
816     }
817  
818     tmp_args_element_name_10 = var_d;
819     if ( var_e == NULL )
820     {
821  
822         exception_type = PyExc_UnboundLocalError;
823         Py_INCREF( exception_type );
824         exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "e" );
825         exception_tb = NULL;
826         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
827         CHAIN_EXCEPTION( exception_value );
828  
829         exception_lineno = 40;
830         type_description_1 = "oooooo";
831         goto frame_exception_exit_1;
832     }
833  
834     tmp_args_element_name_11 = var_e;
835     if ( var_f == NULL )
836     {
837  
838         exception_type = PyExc_UnboundLocalError;
839         Py_INCREF( exception_type );
840         exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "f" );
841         exception_tb = NULL;
842         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
843         CHAIN_EXCEPTION( exception_value );
844  
845         exception_lineno = 40;
846         type_description_1 = "oooooo";
847         goto frame_exception_exit_1;
848     }
849  
850     tmp_args_element_name_12 = var_f;
851     frame_2357e9a1a99cc780bad2dd3528b19359->m_frame.f_lineno = 40;
852     {
853         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 };
854         tmp_call_result_2 = CALL_FUNCTION_WITH_ARGS6( tmp_called_name_8, call_args );
855     }
856  
857     if ( tmp_call_result_2 == NULL )
858     {
859         assert( ERROR_OCCURRED() );
860  
861         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
862  
863  
864         exception_lineno = 40;
865         type_description_1 = "oooooo";
866         goto frame_exception_exit_1;
867     }
868     Py_DECREF( tmp_call_result_2 );
869     }
870     {
871     PyObject *tmp_called_name_9;
872     PyObject *tmp_mvar_value_9;
873     PyObject *tmp_call_result_3;
874     PyObject *tmp_args_element_name_13;
875     PyObject *tmp_args_element_name_14;
876     PyObject *tmp_args_element_name_15;
877     PyObject *tmp_args_element_name_16;
878     PyObject *tmp_args_element_name_17;
879     PyObject *tmp_args_element_name_18;
880     tmp_mvar_value_9 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_compiled_func );
881  
882     if (unlikely( tmp_mvar_value_9 == NULL ))
883     {
884         tmp_mvar_value_9 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_compiled_func );
885     }
886  
887     if ( tmp_mvar_value_9 == NULL )
888     {
889  
890         exception_type = PyExc_NameError;
891         Py_INCREF( exception_type );
892         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "compiled_func" );
893         exception_tb = NULL;
894         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
895         CHAIN_EXCEPTION( exception_value );
896  
897         exception_lineno = 41;
898         type_description_1 = "oooooo";
899         goto frame_exception_exit_1;
900     }
901  
902     tmp_called_name_9 = tmp_mvar_value_9;
903     if ( var_a == NULL )
904     {
905  
906         exception_type = PyExc_UnboundLocalError;
907         Py_INCREF( exception_type );
908         exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "a" );
909         exception_tb = NULL;
910         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
911         CHAIN_EXCEPTION( exception_value );
912  
913         exception_lineno = 41;
914         type_description_1 = "oooooo";
915         goto frame_exception_exit_1;
916     }
917  
918     tmp_args_element_name_13 = var_a;
919     if ( var_b == NULL )
920     {
921  
922         exception_type = PyExc_UnboundLocalError;
923         Py_INCREF( exception_type );
924         exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "b" );
925         exception_tb = NULL;
926         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
927         CHAIN_EXCEPTION( exception_value );
928  
929         exception_lineno = 41;
930         type_description_1 = "oooooo";
931         goto frame_exception_exit_1;
932     }
933  
934     tmp_args_element_name_14 = var_b;
935     if ( var_c == NULL )
936     {
937  
938         exception_type = PyExc_UnboundLocalError;
939         Py_INCREF( exception_type );
940         exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "c" );
941         exception_tb = NULL;
942         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
943         CHAIN_EXCEPTION( exception_value );
944  
945         exception_lineno = 41;
946         type_description_1 = "oooooo";
947         goto frame_exception_exit_1;
948     }
949  
950     tmp_args_element_name_15 = var_c;
951     if ( var_d == NULL )
952     {
953  
954         exception_type = PyExc_UnboundLocalError;
955         Py_INCREF( exception_type );
956         exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "d" );
957         exception_tb = NULL;
958         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
959         CHAIN_EXCEPTION( exception_value );
960  
961         exception_lineno = 41;
962         type_description_1 = "oooooo";
963         goto frame_exception_exit_1;
964     }
965  
966     tmp_args_element_name_16 = var_d;
967     if ( var_f == NULL )
968     {
969  
970         exception_type = PyExc_UnboundLocalError;
971         Py_INCREF( exception_type );
972         exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "f" );
973         exception_tb = NULL;
974         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
975         CHAIN_EXCEPTION( exception_value );
976  
977         exception_lineno = 41;
978         type_description_1 = "oooooo";
979         goto frame_exception_exit_1;
980     }
981  
982     tmp_args_element_name_17 = var_f;
983     if ( var_e == NULL )
984     {
985  
986         exception_type = PyExc_UnboundLocalError;
987         Py_INCREF( exception_type );
988         exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "e" );
989         exception_tb = NULL;
990         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
991         CHAIN_EXCEPTION( exception_value );
992  
993         exception_lineno = 41;
994         type_description_1 = "oooooo";
995         goto frame_exception_exit_1;
996     }
997  
998     tmp_args_element_name_18 = var_e;
999     frame_2357e9a1a99cc780bad2dd3528b19359->m_frame.f_lineno = 41;
1000     {
1001         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 };
1002         tmp_call_result_3 = CALL_FUNCTION_WITH_ARGS6( tmp_called_name_9, call_args );
1003     }
1004  
1005     if ( tmp_call_result_3 == NULL )
1006     {
1007         assert( ERROR_OCCURRED() );
1008  
1009         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
1010  
1011  
1012         exception_lineno = 41;
1013         type_description_1 = "oooooo";
1014         goto frame_exception_exit_1;
1015     }
1016     Py_DECREF( tmp_call_result_3 );
1017     }
1018 588
1019 #if 0 589 #if 0
1020     RESTORE_FRAME_EXCEPTION( frame_2357e9a1a99cc780bad2dd3528b19359 ); 590     RESTORE_FRAME_EXCEPTION( frame_2357e9a1a99cc780bad2dd3528b19359 );
1021 #endif 591 #endif
1022 592
1139 709
1140     } 710     }
1141     { 711     {
1142     Py_XDECREF( var_a ); 712     Py_XDECREF( var_a );
1143     var_a = NULL; 713     var_a = NULL;
t 1144   t
1145     }
1146     {
1147     Py_XDECREF( var_f );
1148     var_f = NULL;
1149 714
1150     } 715     }
1151     { 716     {
1152     Py_XDECREF( var_d ); 717     Py_XDECREF( var_d );
1153     var_d = NULL; 718     var_d = NULL;