Construct RichComparisonStrings

Performance Diagrams

Construct RichComparisonStrings 001000000100000020000002000000300000030000004000000400000050000005000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)591316389.78846153846155257.0CPython 2.75150499244.59615384615387288.87228352952684Nuitka (master)5149682399.4038461538462288.9064265540352Nuitka (develop)5150258554.2115384615385288.88235509489596Nuitka (factory)Construct RichComparisonStringsTicks Construct RichComparisonStrings 00100000010000002000000200000030000003000000400000040000005000000500000060000006000000700000070000008000000800000090000009000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)909826689.78846153846155257.0CPython 3.58250000244.59615384615387280.03950872024996Nuitka (master)8250038399.4038461538462280.03847661318525Nuitka (develop)8249938554.2115384615385280.0411926844082Nuitka (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
712         CHECK_OBJECT(tmp_for_loop_1__iter_value); 712         CHECK_OBJECT(tmp_for_loop_1__iter_value);
713         tmp_assign_source_11 = tmp_for_loop_1__iter_value; 713         tmp_assign_source_11 = tmp_for_loop_1__iter_value;
714         UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)const_str_plain_x, tmp_assign_source_11); 714         UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)const_str_plain_x, tmp_assign_source_11);
715     } 715     }
716     { 716     {
n 717         PyObject *tmp_compexpr_left_2; n
718         PyObject *tmp_compexpr_right_2;
719         PyObject *tmp_mvar_value_5; 717         PyObject *tmp_mvar_value_5;
n 720         PyObject *tmp_mvar_value_6; n
721         tmp_mvar_value_5 = GET_STRING_DICT_VALUE(moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value1); 718         tmp_mvar_value_5 = GET_STRING_DICT_VALUE(moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value1);
722 719
723         if (unlikely( tmp_mvar_value_5 == NULL )) { 720         if (unlikely( tmp_mvar_value_5 == NULL )) {
724             tmp_mvar_value_5 = GET_STRING_DICT_VALUE(dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value1); 721             tmp_mvar_value_5 = GET_STRING_DICT_VALUE(dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value1);
725         } 722         }
732             exception_value = UNSTREAM_STRING( &constant_bin[ 57 ], 35, 0 ); 729             exception_value = UNSTREAM_STRING( &constant_bin[ 57 ], 35, 0 );
733             exception_tb = NULL; 730             exception_tb = NULL;
734             NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); 731             NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
735             CHAIN_EXCEPTION( exception_value ); 732             CHAIN_EXCEPTION( exception_value );
736 733
n 737             exception_lineno = 29; n 734             exception_lineno = 31;
738 735
739             goto try_except_handler_1; 736             goto try_except_handler_1;
740         } 737         }
741 738
n 742         tmp_compexpr_left_2 = tmp_mvar_value_5; n 739     }
740     {
741         PyObject *tmp_mvar_value_6;
743         tmp_mvar_value_6 = GET_STRING_DICT_VALUE(moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2); 742         tmp_mvar_value_6 = GET_STRING_DICT_VALUE(moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2);
744 743
745         if (unlikely( tmp_mvar_value_6 == NULL )) { 744         if (unlikely( tmp_mvar_value_6 == NULL )) {
746             tmp_mvar_value_6 = GET_STRING_DICT_VALUE(dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value2); 745             tmp_mvar_value_6 = GET_STRING_DICT_VALUE(dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value2);
747         } 746         }
754             exception_value = UNSTREAM_STRING( &constant_bin[ 92 ], 35, 0 ); 753             exception_value = UNSTREAM_STRING( &constant_bin[ 92 ], 35, 0 );
755             exception_tb = NULL; 754             exception_tb = NULL;
756             NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); 755             NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
757             CHAIN_EXCEPTION( exception_value ); 756             CHAIN_EXCEPTION( exception_value );
758 757
n 759             exception_lineno = 29; n 758             exception_lineno = 32;
760 759
761             goto try_except_handler_1; 760             goto try_except_handler_1;
762         } 761         }
763 762
t 764         tmp_compexpr_right_2 = tmp_mvar_value_6; t
765         tmp_res = RICH_COMPARE_BOOL_EQ_OBJECT_OBJECT_NORECURSE( tmp_compexpr_left_2, tmp_compexpr_right_2 );
766         if ( tmp_res == -1 )
767         {
768             assert(ERROR_OCCURRED());
769  
770             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
771  
772  
773             exception_lineno = 29;
774  
775             goto try_except_handler_1;
776         }
777     } 763     }
778     if ( CONSIDER_THREADING() == false ) 764     if ( CONSIDER_THREADING() == false )
779     { 765     {
780         assert(ERROR_OCCURRED()); 766         assert(ERROR_OCCURRED());
781 767