Construct RichComparisonStrings

Performance Diagrams

Construct RichComparisonStrings 0010000001000000200000020000003000000300000040000004000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)475450489.78846153846155257.0CPython 2.73999554244.59615384615387296.23853247686503Nuitka (master)3999540399.4038461538462296.2392601269805Nuitka (develop)3999546554.2115384615385296.238948276931Nuitka (factory)Construct RichComparisonStringsTicks Construct RichComparisonStrings 001000000100000020000002000000300000030000004000000400000050000005000000600000060000007000000700000080000008000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)859783089.78846153846155257.0CPython 3.56439838244.59615384615387319.0241413329786Nuitka (master)6453445399.4038461538462318.63305439145245Nuitka (develop)6458399554.2115384615385318.49066850857446Nuitka (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
316     PyObject *tmp_called_name_1; 316     PyObject *tmp_called_name_1;
317     PyObject *tmp_called_name_2; 317     PyObject *tmp_called_name_2;
318     int tmp_cmp_Lt_1; 318     int tmp_cmp_Lt_1;
319     PyObject *tmp_compare_left_1; 319     PyObject *tmp_compare_left_1;
320     PyObject *tmp_compare_right_1; 320     PyObject *tmp_compare_right_1;
n 321     PyObject *tmp_compexpr_left_1; n
322     PyObject *tmp_compexpr_right_1;
323     PyObject *tmp_fromlist_name_1; 321     PyObject *tmp_fromlist_name_1;
324     PyObject *tmp_fromlist_name_2; 322     PyObject *tmp_fromlist_name_2;
325     PyObject *tmp_globals_name_1; 323     PyObject *tmp_globals_name_1;
326     PyObject *tmp_globals_name_2; 324     PyObject *tmp_globals_name_2;
327     PyObject *tmp_int_arg_1; 325     PyObject *tmp_int_arg_1;
645 643
646     tmp_assign_source_14 = tmp_for_loop_1__iter_value; 644     tmp_assign_source_14 = tmp_for_loop_1__iter_value;
647 645
648     CHECK_OBJECT( tmp_assign_source_14 ); 646     CHECK_OBJECT( tmp_assign_source_14 );
649     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain_x, tmp_assign_source_14 ); 647     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain_x, tmp_assign_source_14 );
n 650     tmp_compexpr_left_1 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value1 ); n 648     tmp_unused = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value1 );
651 649
n 652     if (unlikely( tmp_compexpr_left_1 == NULL )) n 650     if (unlikely( tmp_unused == NULL ))
653     { 651     {
n 654         tmp_compexpr_left_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value1 ); n 652         tmp_unused = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value1 );
655     } 653     }
656 654
n 657     if ( tmp_compexpr_left_1 == NULL ) n 655     if ( tmp_unused == NULL )
658     { 656     {
659 657
660         exception_type = PyExc_NameError; 658         exception_type = PyExc_NameError;
661         Py_INCREF( exception_type ); 659         Py_INCREF( exception_type );
662         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value1" ); 660         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value1" );
663         exception_tb = NULL; 661         exception_tb = NULL;
664         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); 662         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
665         CHAIN_EXCEPTION( exception_value ); 663         CHAIN_EXCEPTION( exception_value );
666 664
n 667         exception_lineno = 29; n 665         exception_lineno = 31;
668 666
669         goto try_except_handler_1; 667         goto try_except_handler_1;
670     } 668     }
671 669
n 672     tmp_compexpr_right_1 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2 ); n 670     tmp_unused = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2 );
673 671
n 674     if (unlikely( tmp_compexpr_right_1 == NULL )) n 672     if (unlikely( tmp_unused == NULL ))
675     { 673     {
n 676         tmp_compexpr_right_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value2 ); n 674         tmp_unused = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value2 );
677     } 675     }
678 676
n 679     if ( tmp_compexpr_right_1 == NULL ) n 677     if ( tmp_unused == NULL )
680     { 678     {
681 679
682         exception_type = PyExc_NameError; 680         exception_type = PyExc_NameError;
683         Py_INCREF( exception_type ); 681         Py_INCREF( exception_type );
684         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value2" ); 682         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value2" );
685         exception_tb = NULL; 683         exception_tb = NULL;
686         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); 684         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
687         CHAIN_EXCEPTION( exception_value ); 685         CHAIN_EXCEPTION( exception_value );
688 686
n 689         exception_lineno = 29; n 687         exception_lineno = 32;
690 688
691         goto try_except_handler_1; 689         goto try_except_handler_1;
692     } 690     }
693 691
t 694     tmp_unused = RICH_COMPARE_EQ_NORECURSE( tmp_compexpr_left_1, tmp_compexpr_right_1 ); t
695     if ( tmp_unused == NULL )
696     {
697         assert( ERROR_OCCURRED() );
698  
699         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
700  
701  
702         exception_lineno = 29;
703  
704         goto try_except_handler_1;
705     }
706     Py_DECREF( tmp_unused );
707     if ( CONSIDER_THREADING() == false ) 692     if ( CONSIDER_THREADING() == false )
708     { 693     {
709         assert( ERROR_OCCURRED() ); 694         assert( ERROR_OCCURRED() );
710 695
711         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); 696         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );