Construct RichComparisonStrings

Performance Diagrams

Construct RichComparisonStrings 001000000100000020000002000000300000030000004000000400000050000005000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)566281789.78846153846155257.0CPython 2.73950363244.59615384615387331.7284838705107Nuitka (master)4400234399.4038461538462312.09690382963925Nuitka (develop)4400086554.2115384615385312.10336228961125Nuitka (factory)Construct RichComparisonStringsTicks Construct RichComparisonStrings 0010000001000000200000020000003000000300000040000004000000500000050000006000000600000070000007000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)799726789.78846153846155257.0CPython 3.56403590244.59615384615387306.2445862827504Nuitka (master)6799993399.4038461538462293.9957417952908Nuitka (develop)6799965554.2115384615385293.99660699471076Nuitka (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
709     CHECK_OBJECT( tmp_for_loop_1__iter_value ); 709     CHECK_OBJECT( tmp_for_loop_1__iter_value );
710     tmp_assign_source_11 = tmp_for_loop_1__iter_value; 710     tmp_assign_source_11 = tmp_for_loop_1__iter_value;
711     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain_x, tmp_assign_source_11 ); 711     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain_x, tmp_assign_source_11 );
712     } 712     }
713     { 713     {
n 714     PyObject *tmp_compexpr_left_2; n
715     PyObject *tmp_compexpr_right_2;
716     PyObject *tmp_mvar_value_5; 714     PyObject *tmp_mvar_value_5;
n 717     PyObject *tmp_mvar_value_6; n
718     tmp_mvar_value_5 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value1 ); 715     tmp_mvar_value_5 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value1 );
719 716
720     if (unlikely( tmp_mvar_value_5 == NULL )) 717     if (unlikely( tmp_mvar_value_5 == NULL ))
721     { 718     {
722         tmp_mvar_value_5 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value1 ); 719         tmp_mvar_value_5 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value1 );
730         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value1" ); 727         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value1" );
731         exception_tb = NULL; 728         exception_tb = NULL;
732         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); 729         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
733         CHAIN_EXCEPTION( exception_value ); 730         CHAIN_EXCEPTION( exception_value );
734 731
n 735         exception_lineno = 29; n 732         exception_lineno = 31;
736 733
737         goto try_except_handler_1; 734         goto try_except_handler_1;
738     } 735     }
739 736
n 740     tmp_compexpr_left_2 = tmp_mvar_value_5; n 737     }
738     {
739     PyObject *tmp_mvar_value_6;
741     tmp_mvar_value_6 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2 ); 740     tmp_mvar_value_6 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2 );
742 741
743     if (unlikely( tmp_mvar_value_6 == NULL )) 742     if (unlikely( tmp_mvar_value_6 == NULL ))
744     { 743     {
745         tmp_mvar_value_6 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value2 ); 744         tmp_mvar_value_6 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value2 );
753         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value2" ); 752         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value2" );
754         exception_tb = NULL; 753         exception_tb = NULL;
755         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); 754         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
756         CHAIN_EXCEPTION( exception_value ); 755         CHAIN_EXCEPTION( exception_value );
757 756
n 758         exception_lineno = 29; n 757         exception_lineno = 32;
759 758
760         goto try_except_handler_1; 759         goto try_except_handler_1;
761     } 760     }
762 761
t 763     tmp_compexpr_right_2 = tmp_mvar_value_6; t
764     tmp_res = RICH_COMPARE_BOOL_EQ_NORECURSE( tmp_compexpr_left_2, tmp_compexpr_right_2 );
765     if ( tmp_res == -1 )
766     {
767         assert( ERROR_OCCURRED() );
768  
769         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
770  
771  
772         exception_lineno = 29;
773  
774         goto try_except_handler_1;
775     }
776     } 762     }
777     if ( CONSIDER_THREADING() == false ) 763     if ( CONSIDER_THREADING() == false )
778     { 764     {
779         assert( ERROR_OCCURRED() ); 765         assert( ERROR_OCCURRED() );
780 766