Construct RichComparisonStrings

Performance Diagrams

Construct RichComparisonStrings 001000000100000020000002000000300000030000004000000400000050000005000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)566281789.78846153846155257.0CPython 2.73949907244.59615384615387331.74838290934326Nuitka (master)5050042399.4038461538462283.7404243873133Nuitka (develop)5049982554.2115384615385283.74304268189655Nuitka (factory)Construct RichComparisonStringsTicks Construct RichComparisonStrings 0010000001000000200000020000003000000300000040000004000000500000050000006000000600000070000007000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)799726789.78846153846155257.0CPython 3.56400078244.59615384615387306.35310700999Nuitka (master)6849826399.4038461538462292.4559031277137Nuitka (develop)6852124554.2115384615385292.3848949753229Nuitka (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
700     CHECK_OBJECT( tmp_for_loop_1__iter_value ); 700     CHECK_OBJECT( tmp_for_loop_1__iter_value );
701     tmp_assign_source_11 = tmp_for_loop_1__iter_value; 701     tmp_assign_source_11 = tmp_for_loop_1__iter_value;
702     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain_x, tmp_assign_source_11 ); 702     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain_x, tmp_assign_source_11 );
703     } 703     }
704     { 704     {
n 705     PyObject *tmp_compexpr_left_2; n
706     PyObject *tmp_compexpr_right_2;
707     PyObject *tmp_mvar_value_5; 705     PyObject *tmp_mvar_value_5;
n 708     PyObject *tmp_mvar_value_6; n
709     tmp_mvar_value_5 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value1 ); 706     tmp_mvar_value_5 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value1 );
710 707
711     if (unlikely( tmp_mvar_value_5 == NULL )) 708     if (unlikely( tmp_mvar_value_5 == NULL ))
712     { 709     {
713         tmp_mvar_value_5 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value1 ); 710         tmp_mvar_value_5 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value1 );
721         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value1" ); 718         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value1" );
722         exception_tb = NULL; 719         exception_tb = NULL;
723         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); 720         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
724         CHAIN_EXCEPTION( exception_value ); 721         CHAIN_EXCEPTION( exception_value );
725 722
n 726         exception_lineno = 29; n 723         exception_lineno = 31;
727 724
728         goto try_except_handler_1; 725         goto try_except_handler_1;
729     } 726     }
730 727
n 731     tmp_compexpr_left_2 = tmp_mvar_value_5; n 728     }
729     {
730     PyObject *tmp_mvar_value_6;
732     tmp_mvar_value_6 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2 ); 731     tmp_mvar_value_6 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2 );
733 732
734     if (unlikely( tmp_mvar_value_6 == NULL )) 733     if (unlikely( tmp_mvar_value_6 == NULL ))
735     { 734     {
736         tmp_mvar_value_6 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value2 ); 735         tmp_mvar_value_6 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value2 );
744         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value2" ); 743         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value2" );
745         exception_tb = NULL; 744         exception_tb = NULL;
746         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); 745         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
747         CHAIN_EXCEPTION( exception_value ); 746         CHAIN_EXCEPTION( exception_value );
748 747
n 749         exception_lineno = 29; n 748         exception_lineno = 32;
750 749
751         goto try_except_handler_1; 750         goto try_except_handler_1;
752     } 751     }
753 752
t 754     tmp_compexpr_right_2 = tmp_mvar_value_6; t
755     tmp_res = RICH_COMPARE_BOOL_EQ_OBJECT_OBJECT_NORECURSE( tmp_compexpr_left_2, tmp_compexpr_right_2 );
756     if ( tmp_res == -1 )
757     {
758         assert( ERROR_OCCURRED() );
759  
760         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
761  
762  
763         exception_lineno = 29;
764  
765         goto try_except_handler_1;
766     }
767     } 753     }
768     if ( CONSIDER_THREADING() == false ) 754     if ( CONSIDER_THREADING() == false )
769     { 755     {
770         assert( ERROR_OCCURRED() ); 756         assert( ERROR_OCCURRED() );
771 757