Construct CallCompiledFunctionPosArgsVariable

Performance Diagrams

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