Construct RichComparisonStrings

Performance Diagrams

Construct RichComparisonStrings 001000000100000020000002000000300000030000004000000400000050000005000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)566281789.78846153846155257.0CPython 2.73949718244.59615384615387331.75663053728044Nuitka (master)3950960399.4038461538462331.7024318394076Nuitka (develop)3949892554.2115384615385331.7490374829891Nuitka (factory)Construct RichComparisonStringsTicks Construct RichComparisonStrings 0010000001000000200000020000003000000300000040000004000000500000050000006000000600000070000007000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)799726789.78846153846155257.0CPython 3.56400445244.59615384615387306.3417667175934Nuitka (master)6400335399.4038461538462306.34516571531447Nuitka (develop)6400591554.2115384615385306.33725532061817Nuitka (factory)Construct RichComparisonStringsTicks

Source Code with Construct

module_value1 = "1000"
module_value2 = "2000"

import sys
loop_count = 50000 if len(sys.argv) < 2 else int(sys.argv[1])

import itertools
for x in itertools.repeat(None, loop_count):
# construct_begin
    module_value1 == module_value2
# construct_alternative




print("OK.")

Source Code without Construct

module_value1 = "1000"
module_value2 = "2000"

import sys
loop_count = 50000 if len(sys.argv) < 2 else int(sys.argv[1])

import itertools
for x in itertools.repeat(None, loop_count):
# construct_begin

# construct_alternative
    module_value1
    module_value2
# construct_end

print("OK.")

Context Diff of Source Code


Construct
Baseline
24 loop_count = 50000 if len(sys.argv) < 2 else int(sys.argv[1]) 24 loop_count = 50000 if len(sys.argv) < 2 else int(sys.argv[1])
25 25
26 import itertools 26 import itertools
27 for x in itertools.repeat(None, loop_count): 27 for x in itertools.repeat(None, loop_count):
28 # construct_begin 28 # construct_begin
n 29     module_value1 == module_value2 n 29  
30 # construct_alternative 30 # construct_alternative
t 31   t 31     module_value1
32   32     module_value2
33   33 # construct_end
34 34
35 print("OK.") 35 print("OK.")
36 36

Context Diff of Generated Code


Construct
Baseline
771 771
772     CHECK_OBJECT( tmp_assign_source_11 ); 772     CHECK_OBJECT( tmp_assign_source_11 );
773     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain_x, tmp_assign_source_11 ); 773     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain_x, tmp_assign_source_11 );
774     } 774     }
775     { 775     {
n 776     PyObject *tmp_compexpr_left_1; n
777     PyObject *tmp_compexpr_right_1;
778     tmp_compexpr_left_1 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value1 ); 776     tmp_unused = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value1 );
779 777
n 780     if (unlikely( tmp_compexpr_left_1 == NULL )) n 778     if (unlikely( tmp_unused == NULL ))
781     { 779     {
n 782         tmp_compexpr_left_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value1 ); n 780         tmp_unused = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value1 );
783     } 781     }
784 782
n 785     if ( tmp_compexpr_left_1 == NULL ) n 783     if ( tmp_unused == NULL )
786     { 784     {
787 785
788         exception_type = PyExc_NameError; 786         exception_type = PyExc_NameError;
789         Py_INCREF( exception_type ); 787         Py_INCREF( exception_type );
790         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value1" ); 788         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value1" );
791         exception_tb = NULL; 789         exception_tb = NULL;
792         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); 790         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
793         CHAIN_EXCEPTION( exception_value ); 791         CHAIN_EXCEPTION( exception_value );
794 792
n 795         exception_lineno = 29; n 793         exception_lineno = 31;
796 794
797         goto try_except_handler_1; 795         goto try_except_handler_1;
798     } 796     }
799 797
n n 798     }
799     {
800     tmp_compexpr_right_1 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2 ); 800     tmp_unused = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2 );
801 801
n 802     if (unlikely( tmp_compexpr_right_1 == NULL )) n 802     if (unlikely( tmp_unused == NULL ))
803     { 803     {
n 804         tmp_compexpr_right_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value2 ); n 804         tmp_unused = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value2 );
805     } 805     }
806 806
n 807     if ( tmp_compexpr_right_1 == NULL ) n 807     if ( tmp_unused == NULL )
808     { 808     {
809 809
810         exception_type = PyExc_NameError; 810         exception_type = PyExc_NameError;
811         Py_INCREF( exception_type ); 811         Py_INCREF( exception_type );
812         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value2" ); 812         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value2" );
813         exception_tb = NULL; 813         exception_tb = NULL;
814         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); 814         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
815         CHAIN_EXCEPTION( exception_value ); 815         CHAIN_EXCEPTION( exception_value );
816 816
n 817         exception_lineno = 29; n 817         exception_lineno = 32;
818 818
819         goto try_except_handler_1; 819         goto try_except_handler_1;
820     } 820     }
821 821
t 822     tmp_unused = RICH_COMPARE_EQ_NORECURSE( tmp_compexpr_left_1, tmp_compexpr_right_1 ); t
823     if ( tmp_unused == NULL )
824     {
825         assert( ERROR_OCCURRED() );
826  
827         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
828  
829  
830         exception_lineno = 29;
831  
832         goto try_except_handler_1;
833     }
834     Py_DECREF( tmp_unused );
835     } 822     }
836     if ( CONSIDER_THREADING() == false ) 823     if ( CONSIDER_THREADING() == false )
837     { 824     {
838         assert( ERROR_OCCURRED() ); 825         assert( ERROR_OCCURRED() );
839 826