Construct RichComparisonStrings

Performance Diagrams

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