Construct RichComparisonStrings

Performance Diagrams

Construct RichComparisonStrings 001000000100000020000002000000300000030000004000000400000050000005000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)566279689.78846153846155257.0CPython 2.73949977244.59615384615387331.74468901255466Nuitka (master)3949905399.4038461538462331.74783097770626Nuitka (develop)3950121554.2115384615385331.7384050822516Nuitka (factory)Construct RichComparisonStringsTicks Construct RichComparisonStrings 0010000001000000200000020000003000000300000040000004000000500000050000006000000600000070000007000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)799741189.78846153846155257.0CPython 3.56400296244.59615384615387306.3499318091817Nuitka (master)6402580399.4038461538462306.27935752727205Nuitka (develop)6403796554.2115384615385306.24178382902244Nuitka (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
309     PyObject *tmp_called_name_1; 309     PyObject *tmp_called_name_1;
310     PyObject *tmp_called_name_2; 310     PyObject *tmp_called_name_2;
311     int tmp_cmp_Lt_1; 311     int tmp_cmp_Lt_1;
312     PyObject *tmp_compare_left_1; 312     PyObject *tmp_compare_left_1;
313     PyObject *tmp_compare_right_1; 313     PyObject *tmp_compare_right_1;
n 314     PyObject *tmp_compexpr_left_1; n
315     PyObject *tmp_compexpr_right_1;
316     PyObject *tmp_fromlist_name_1; 314     PyObject *tmp_fromlist_name_1;
317     PyObject *tmp_fromlist_name_2; 315     PyObject *tmp_fromlist_name_2;
318     PyObject *tmp_globals_name_1; 316     PyObject *tmp_globals_name_1;
319     PyObject *tmp_globals_name_2; 317     PyObject *tmp_globals_name_2;
320     PyObject *tmp_int_arg_1; 318     PyObject *tmp_int_arg_1;
639 637
640     tmp_assign_source_14 = tmp_for_loop_1__iter_value; 638     tmp_assign_source_14 = tmp_for_loop_1__iter_value;
641 639
642     CHECK_OBJECT( tmp_assign_source_14 ); 640     CHECK_OBJECT( tmp_assign_source_14 );
643     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain_x, tmp_assign_source_14 ); 641     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain_x, tmp_assign_source_14 );
n 644     tmp_compexpr_left_1 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value1 ); n 642     tmp_unused = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value1 );
645 643
n 646     if (unlikely( tmp_compexpr_left_1 == NULL )) n 644     if (unlikely( tmp_unused == NULL ))
647     { 645     {
n 648         tmp_compexpr_left_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value1 ); n 646         tmp_unused = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value1 );
649     } 647     }
650 648
n 651     if ( tmp_compexpr_left_1 == NULL ) n 649     if ( tmp_unused == NULL )
652     { 650     {
653 651
654         exception_type = PyExc_NameError; 652         exception_type = PyExc_NameError;
655         Py_INCREF( exception_type ); 653         Py_INCREF( exception_type );
656         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value1" ); 654         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value1" );
657         exception_tb = NULL; 655         exception_tb = NULL;
658         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); 656         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
659         CHAIN_EXCEPTION( exception_value ); 657         CHAIN_EXCEPTION( exception_value );
660 658
n 661         exception_lineno = 29; n 659         exception_lineno = 31;
662 660
663         goto try_except_handler_1; 661         goto try_except_handler_1;
664     } 662     }
665 663
n 666     tmp_compexpr_right_1 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2 ); n 664     tmp_unused = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2 );
667 665
n 668     if (unlikely( tmp_compexpr_right_1 == NULL )) n 666     if (unlikely( tmp_unused == NULL ))
669     { 667     {
n 670         tmp_compexpr_right_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value2 ); n 668         tmp_unused = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value2 );
671     } 669     }
672 670
n 673     if ( tmp_compexpr_right_1 == NULL ) n 671     if ( tmp_unused == NULL )
674     { 672     {
675 673
676         exception_type = PyExc_NameError; 674         exception_type = PyExc_NameError;
677         Py_INCREF( exception_type ); 675         Py_INCREF( exception_type );
678         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value2" ); 676         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value2" );
679         exception_tb = NULL; 677         exception_tb = NULL;
680         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); 678         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
681         CHAIN_EXCEPTION( exception_value ); 679         CHAIN_EXCEPTION( exception_value );
682 680
n 683         exception_lineno = 29; n 681         exception_lineno = 32;
684 682
685         goto try_except_handler_1; 683         goto try_except_handler_1;
686     } 684     }
687 685
t 688     tmp_unused = RICH_COMPARE_EQ_NORECURSE( tmp_compexpr_left_1, tmp_compexpr_right_1 ); t
689     if ( tmp_unused == NULL )
690     {
691         assert( ERROR_OCCURRED() );
692  
693         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
694  
695  
696         exception_lineno = 29;
697  
698         goto try_except_handler_1;
699     }
700     Py_DECREF( tmp_unused );
701     if ( CONSIDER_THREADING() == false ) 686     if ( CONSIDER_THREADING() == false )
702     { 687     {
703         assert( ERROR_OCCURRED() ); 688         assert( ERROR_OCCURRED() );
704 689
705         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); 690         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );