Construct CallCompiledFunctionPosArgsVariable

Performance Diagrams

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