Construct CallCompiledFunctionPosArgsVariable

Performance Diagrams

Construct CallCompiledFunctionPosArgsVariable 002000000020000000400000004000000060000000600000008000000080000000100000000100000000120000000120000000140000000140000000160000000160000000180000000180000000200000000200000000220000000220000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)23943977888.11538461538461257.0CPython 2.761100042240.03846153846155441.05668774820765Nuitka (master)61099916391.96153846153845441.05681778732946Nuitka (develop)61099944543.8846153846154441.0567888897468Nuitka (factory)Construct CallCompiledFunctionPosArgsVariableTicks Construct CallCompiledFunctionPosArgsVariable 002000000020000000400000004000000060000000600000008000000080000000100000000100000000120000000120000000140000000140000000160000000160000000180000000180000000200000000200000000220000000220000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)22295084688.11538461538461257.0CPython 3.569248834240.03846153846155427.3610122723574Nuitka (master)68801365391.96153846153845427.8569802223443Nuitka (develop)68795445543.8846153846154427.86354186184093Nuitka (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
588     } 588     }
589     assert( var_f == NULL ); 589     assert( var_f == NULL );
590     var_f = tmp_assign_source_6; 590     var_f = tmp_assign_source_6;
591 591
592     } 592     }
n 593     { n
594     PyObject *tmp_called_name_7;
595     PyObject *tmp_mvar_value_7;
596     PyObject *tmp_call_result_1;
597     PyObject *tmp_args_element_name_1;
598     PyObject *tmp_args_element_name_2;
599     PyObject *tmp_args_element_name_3;
600     PyObject *tmp_args_element_name_4;
601     PyObject *tmp_args_element_name_5;
602     PyObject *tmp_args_element_name_6;
603     tmp_mvar_value_7 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_compiled_func );
604  
605     if (unlikely( tmp_mvar_value_7 == NULL ))
606     {
607         tmp_mvar_value_7 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_compiled_func );
608     }
609  
610     if ( tmp_mvar_value_7 == NULL )
611     {
612  
613         exception_type = PyExc_NameError;
614         Py_INCREF( exception_type );
615         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "compiled_func" );
616         exception_tb = NULL;
617         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
618         CHAIN_EXCEPTION( exception_value );
619  
620         exception_lineno = 39;
621         type_description_1 = "oooooo";
622         goto frame_exception_exit_1;
623     }
624  
625     tmp_called_name_7 = tmp_mvar_value_7;
626     CHECK_OBJECT( var_a );
627     tmp_args_element_name_1 = var_a;
628     CHECK_OBJECT( var_b );
629     tmp_args_element_name_2 = var_b;
630     CHECK_OBJECT( var_c );
631     tmp_args_element_name_3 = var_c;
632     CHECK_OBJECT( var_d );
633     tmp_args_element_name_4 = var_d;
634     CHECK_OBJECT( var_e );
635     tmp_args_element_name_5 = var_e;
636     CHECK_OBJECT( var_f );
637     tmp_args_element_name_6 = var_f;
638     frame_bfe4ec4d96d5f0fe5a64eee60e4c71bf->m_frame.f_lineno = 39;
639     {
640         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 };
641         tmp_call_result_1 = CALL_FUNCTION_WITH_ARGS6( tmp_called_name_7, call_args );
642     }
643  
644     if ( tmp_call_result_1 == NULL )
645     {
646         assert( ERROR_OCCURRED() );
647  
648         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
649  
650  
651         exception_lineno = 39;
652         type_description_1 = "oooooo";
653         goto frame_exception_exit_1;
654     }
655     Py_DECREF( tmp_call_result_1 );
656     }
657     {
658     PyObject *tmp_called_name_8;
659     PyObject *tmp_mvar_value_8;
660     PyObject *tmp_call_result_2;
661     PyObject *tmp_args_element_name_7;
662     PyObject *tmp_args_element_name_8;
663     PyObject *tmp_args_element_name_9;
664     PyObject *tmp_args_element_name_10;
665     PyObject *tmp_args_element_name_11;
666     PyObject *tmp_args_element_name_12;
667     tmp_mvar_value_8 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_compiled_func );
668  
669     if (unlikely( tmp_mvar_value_8 == NULL ))
670     {
671         tmp_mvar_value_8 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_compiled_func );
672     }
673  
674     if ( tmp_mvar_value_8 == NULL )
675     {
676  
677         exception_type = PyExc_NameError;
678         Py_INCREF( exception_type );
679         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "compiled_func" );
680         exception_tb = NULL;
681         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
682         CHAIN_EXCEPTION( exception_value );
683  
684         exception_lineno = 40;
685         type_description_1 = "oooooo";
686         goto frame_exception_exit_1;
687     }
688  
689     tmp_called_name_8 = tmp_mvar_value_8;
690     CHECK_OBJECT( var_a );
691     tmp_args_element_name_7 = var_a;
692     CHECK_OBJECT( var_c );
693     tmp_args_element_name_8 = var_c;
694     CHECK_OBJECT( var_b );
695     tmp_args_element_name_9 = var_b;
696     CHECK_OBJECT( var_d );
697     tmp_args_element_name_10 = var_d;
698     CHECK_OBJECT( var_e );
699     tmp_args_element_name_11 = var_e;
700     CHECK_OBJECT( var_f );
701     tmp_args_element_name_12 = var_f;
702     frame_bfe4ec4d96d5f0fe5a64eee60e4c71bf->m_frame.f_lineno = 40;
703     {
704         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 };
705         tmp_call_result_2 = CALL_FUNCTION_WITH_ARGS6( tmp_called_name_8, call_args );
706     }
707  
708     if ( tmp_call_result_2 == NULL )
709     {
710         assert( ERROR_OCCURRED() );
711  
712         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
713  
714  
715         exception_lineno = 40;
716         type_description_1 = "oooooo";
717         goto frame_exception_exit_1;
718     }
719     Py_DECREF( tmp_call_result_2 );
720     }
721     {
722     PyObject *tmp_called_name_9;
723     PyObject *tmp_mvar_value_9;
724     PyObject *tmp_call_result_3;
725     PyObject *tmp_args_element_name_13;
726     PyObject *tmp_args_element_name_14;
727     PyObject *tmp_args_element_name_15;
728     PyObject *tmp_args_element_name_16;
729     PyObject *tmp_args_element_name_17;
730     PyObject *tmp_args_element_name_18;
731     tmp_mvar_value_9 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_compiled_func );
732  
733     if (unlikely( tmp_mvar_value_9 == NULL ))
734     {
735         tmp_mvar_value_9 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_compiled_func );
736     }
737  
738     if ( tmp_mvar_value_9 == NULL )
739     {
740  
741         exception_type = PyExc_NameError;
742         Py_INCREF( exception_type );
743         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "compiled_func" );
744         exception_tb = NULL;
745         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
746         CHAIN_EXCEPTION( exception_value );
747  
748         exception_lineno = 41;
749         type_description_1 = "oooooo";
750         goto frame_exception_exit_1;
751     }
752  
753     tmp_called_name_9 = tmp_mvar_value_9;
754     CHECK_OBJECT( var_a );
755     tmp_args_element_name_13 = var_a;
756     CHECK_OBJECT( var_b );
757     tmp_args_element_name_14 = var_b;
758     CHECK_OBJECT( var_c );
759     tmp_args_element_name_15 = var_c;
760     CHECK_OBJECT( var_d );
761     tmp_args_element_name_16 = var_d;
762     CHECK_OBJECT( var_f );
763     tmp_args_element_name_17 = var_f;
764     CHECK_OBJECT( var_e );
765     tmp_args_element_name_18 = var_e;
766     frame_bfe4ec4d96d5f0fe5a64eee60e4c71bf->m_frame.f_lineno = 41;
767     {
768         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 };
769         tmp_call_result_3 = CALL_FUNCTION_WITH_ARGS6( tmp_called_name_9, call_args );
770     }
771  
772     if ( tmp_call_result_3 == NULL )
773     {
774         assert( ERROR_OCCURRED() );
775  
776         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
777  
778  
779         exception_lineno = 41;
780         type_description_1 = "oooooo";
781         goto frame_exception_exit_1;
782     }
783     Py_DECREF( tmp_call_result_3 );
784     }
785 593
786 #if 0 594 #if 0
787     RESTORE_FRAME_EXCEPTION( frame_bfe4ec4d96d5f0fe5a64eee60e4c71bf ); 595     RESTORE_FRAME_EXCEPTION( frame_bfe4ec4d96d5f0fe5a64eee60e4c71bf );
788 #endif 596 #endif
789 597
912 720
913     } 721     }
914     { 722     {
915     Py_XDECREF( var_a ); 723     Py_XDECREF( var_a );
916     var_a = NULL; 724     var_a = NULL;
t 917   t
918     }
919     {
920     Py_XDECREF( var_f );
921     var_f = NULL;
922 725
923     } 726     }
924     { 727     {
925     Py_XDECREF( var_d ); 728     Py_XDECREF( var_d );
926     var_d = NULL; 729     var_d = NULL;