Construct RichComparisonStrings

Performance Diagrams

Construct RichComparisonStrings 001000000100000020000002000000300000030000004000000400000050000005000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)581233489.78846153846155257.0CPython 2.74949982244.59615384615387293.66348942676836Nuitka (master)4949994399.4038461538462293.6629792385005Nuitka (develop)4949982554.2115384615385293.66348942676836Nuitka (factory)Construct RichComparisonStringsTicks Construct RichComparisonStrings 001000000100000020000002000000300000030000004000000400000050000005000000600000060000007000000700000080000008000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)809737589.78846153846155257.0CPython 3.56858188244.59615384615387294.81746209300974Nuitka (master)6842038399.4038461538462295.3103271834296Nuitka (develop)6855844554.2115384615385294.8889961965357Nuitka (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
725         CHECK_OBJECT( tmp_for_loop_1__iter_value ); 725         CHECK_OBJECT( tmp_for_loop_1__iter_value );
726         tmp_assign_source_11 = tmp_for_loop_1__iter_value; 726         tmp_assign_source_11 = tmp_for_loop_1__iter_value;
727         UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain_x, tmp_assign_source_11 ); 727         UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain_x, tmp_assign_source_11 );
728     } 728     }
729     { 729     {
n 730         PyObject *tmp_compexpr_left_2; n
731         PyObject *tmp_compexpr_right_2;
732         PyObject *tmp_mvar_value_5; 730         PyObject *tmp_mvar_value_5;
n 733         PyObject *tmp_mvar_value_6; n
734         tmp_mvar_value_5 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value1 ); 731         tmp_mvar_value_5 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value1 );
735 732
736         if (unlikely( tmp_mvar_value_5 == NULL )) 733         if (unlikely( tmp_mvar_value_5 == NULL ))
737         { 734         {
738             tmp_mvar_value_5 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value1 ); 735             tmp_mvar_value_5 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value1 );
746             exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value1" ); 743             exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value1" );
747             exception_tb = NULL; 744             exception_tb = NULL;
748             NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); 745             NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
749             CHAIN_EXCEPTION( exception_value ); 746             CHAIN_EXCEPTION( exception_value );
750 747
n 751             exception_lineno = 29; n 748             exception_lineno = 31;
752 749
753             goto try_except_handler_1; 750             goto try_except_handler_1;
754         } 751         }
755 752
n 756         tmp_compexpr_left_2 = tmp_mvar_value_5; n 753     }
754     {
755         PyObject *tmp_mvar_value_6;
757         tmp_mvar_value_6 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2 ); 756         tmp_mvar_value_6 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2 );
758 757
759         if (unlikely( tmp_mvar_value_6 == NULL )) 758         if (unlikely( tmp_mvar_value_6 == NULL ))
760         { 759         {
761             tmp_mvar_value_6 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value2 ); 760             tmp_mvar_value_6 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value2 );
769             exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value2" ); 768             exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value2" );
770             exception_tb = NULL; 769             exception_tb = NULL;
771             NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); 770             NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
772             CHAIN_EXCEPTION( exception_value ); 771             CHAIN_EXCEPTION( exception_value );
773 772
n 774             exception_lineno = 29; n 773             exception_lineno = 32;
775 774
776             goto try_except_handler_1; 775             goto try_except_handler_1;
777         } 776         }
778 777
t 779         tmp_compexpr_right_2 = tmp_mvar_value_6; t
780         tmp_res = RICH_COMPARE_BOOL_EQ_OBJECT_OBJECT_NORECURSE( tmp_compexpr_left_2, tmp_compexpr_right_2 );
781         if ( tmp_res == -1 )
782         {
783             assert( ERROR_OCCURRED() );
784  
785             FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
786  
787  
788             exception_lineno = 29;
789  
790             goto try_except_handler_1;
791         }
792     } 778     }
793     if ( CONSIDER_THREADING() == false ) 779     if ( CONSIDER_THREADING() == false )
794     { 780     {
795         assert( ERROR_OCCURRED() ); 781         assert( ERROR_OCCURRED() );
796 782