Construct RichComparisonStrings

Performance Diagrams

Construct RichComparisonStrings 001000000100000020000002000000300000030000004000000400000050000005000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)581235689.78846153846155257.0CPython 2.74950168244.59615384615387293.65637810739213Nuitka (master)4949854399.4038461538462293.66972798320313Nuitka (develop)4950108554.2115384615385293.6589290390758Nuitka (factory)Construct RichComparisonStringsTicks Construct RichComparisonStrings 001000000100000020000002000000300000030000004000000400000050000005000000600000060000007000000700000080000008000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)809729789.78846153846155257.0CPython 3.56849976244.59615384615387295.06606187890185Nuitka (master)6855770399.4038461538462294.88923910230596Nuitka (develop)6849700554.2115384615385295.07448491762125Nuitka (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
720         CHECK_OBJECT( tmp_for_loop_1__iter_value ); 720         CHECK_OBJECT( tmp_for_loop_1__iter_value );
721         tmp_assign_source_11 = tmp_for_loop_1__iter_value; 721         tmp_assign_source_11 = tmp_for_loop_1__iter_value;
722         UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain_x, tmp_assign_source_11 ); 722         UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain_x, tmp_assign_source_11 );
723     } 723     }
724     { 724     {
n 725         PyObject *tmp_compexpr_left_2; n
726         PyObject *tmp_compexpr_right_2;
727         PyObject *tmp_mvar_value_5; 725         PyObject *tmp_mvar_value_5;
n 728         PyObject *tmp_mvar_value_6; n
729         tmp_mvar_value_5 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value1 ); 726         tmp_mvar_value_5 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value1 );
730 727
731         if (unlikely( tmp_mvar_value_5 == NULL )) 728         if (unlikely( tmp_mvar_value_5 == NULL ))
732         { 729         {
733             tmp_mvar_value_5 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value1 ); 730             tmp_mvar_value_5 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value1 );
741             exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value1" ); 738             exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value1" );
742             exception_tb = NULL; 739             exception_tb = NULL;
743             NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); 740             NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
744             CHAIN_EXCEPTION( exception_value ); 741             CHAIN_EXCEPTION( exception_value );
745 742
n 746             exception_lineno = 29; n 743             exception_lineno = 31;
747 744
748             goto try_except_handler_1; 745             goto try_except_handler_1;
749         } 746         }
750 747
n 751         tmp_compexpr_left_2 = tmp_mvar_value_5; n 748     }
749     {
750         PyObject *tmp_mvar_value_6;
752         tmp_mvar_value_6 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2 ); 751         tmp_mvar_value_6 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2 );
753 752
754         if (unlikely( tmp_mvar_value_6 == NULL )) 753         if (unlikely( tmp_mvar_value_6 == NULL ))
755         { 754         {
756             tmp_mvar_value_6 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value2 ); 755             tmp_mvar_value_6 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value2 );
764             exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value2" ); 763             exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value2" );
765             exception_tb = NULL; 764             exception_tb = NULL;
766             NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); 765             NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
767             CHAIN_EXCEPTION( exception_value ); 766             CHAIN_EXCEPTION( exception_value );
768 767
n 769             exception_lineno = 29; n 768             exception_lineno = 32;
770 769
771             goto try_except_handler_1; 770             goto try_except_handler_1;
772         } 771         }
773 772
t 774         tmp_compexpr_right_2 = tmp_mvar_value_6; t
775         tmp_res = RICH_COMPARE_BOOL_EQ_OBJECT_OBJECT_NORECURSE( tmp_compexpr_left_2, tmp_compexpr_right_2 );
776         if ( tmp_res == -1 )
777         {
778             assert( ERROR_OCCURRED() );
779  
780             FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
781  
782  
783             exception_lineno = 29;
784  
785             goto try_except_handler_1;
786         }
787     } 773     }
788     if ( CONSIDER_THREADING() == false ) 774     if ( CONSIDER_THREADING() == false )
789     { 775     {
790         assert( ERROR_OCCURRED() ); 776         assert( ERROR_OCCURRED() );
791 777