Construct RichComparisonStrings

Performance Diagrams

Construct RichComparisonStrings 0010000001000000200000020000003000000300000040000004000000CPython 2.7Nuitka (historic)Nuitka (master)Nuitka (develop)Nuitka (factory)475472274.3076923076923257.0CPython 2.73803690198.15384615384616306.4276297250478Nuitka (historic)3999857322.0296.2323157500465Nuitka (master)3999705445.8461538461538296.2402155890826Nuitka (develop)3999765569.6923076923077296.2370972315683Nuitka (factory)Construct RichComparisonStringsTicks Construct RichComparisonStrings 001000000100000020000002000000300000030000004000000400000050000005000000600000060000007000000700000080000008000000CPython 3.5Nuitka (historic)Nuitka (master)Nuitka (develop)Nuitka (factory)859807474.3076923076923257.0CPython 3.50198.15384615384616504.11538461538464Nuitka (historic)6557466322.0315.6486730364534Nuitka (master)6550899445.8461538461538315.8374137626636Nuitka (develop)6549415569.6923076923077315.88006508559585Nuitka (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])

for x in xrange(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])

for x in xrange(loop_count):
# construct_begin

# construct_alternative
    module_value1
    module_value2
# construct_end

print("OK.")

Context Diff of Source Code


Construct
Baseline
23 import sys 23 import sys
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 for x in xrange(loop_count): 26 for x in xrange(loop_count):
27 # construct_begin 27 # construct_begin
n 28     module_value1 == module_value2 n 28  
29 # construct_alternative 29 # construct_alternative
t 30   t 30     module_value1
31   31     module_value2
32   32 # construct_end
33 33
34 print("OK.") 34 print("OK.")
35 35

Context Diff of Generated Code


Construct
Baseline
297     PyObject *tmp_assign_source_11; 297     PyObject *tmp_assign_source_11;
298     PyObject *tmp_called_name_1; 298     PyObject *tmp_called_name_1;
299     int tmp_cmp_Lt_1; 299     int tmp_cmp_Lt_1;
300     PyObject *tmp_compare_left_1; 300     PyObject *tmp_compare_left_1;
301     PyObject *tmp_compare_right_1; 301     PyObject *tmp_compare_right_1;
n 302     PyObject *tmp_compexpr_left_1; n
303     PyObject *tmp_compexpr_right_1;
304     PyObject *tmp_import_globals_1; 302     PyObject *tmp_import_globals_1;
305     PyObject *tmp_int_arg_1; 303     PyObject *tmp_int_arg_1;
306     PyObject *tmp_iter_arg_1; 304     PyObject *tmp_iter_arg_1;
307     PyObject *tmp_len_arg_1; 305     PyObject *tmp_len_arg_1;
308     PyObject *tmp_next_source_1; 306     PyObject *tmp_next_source_1;
559     } 557     }
560 558
561     tmp_assign_source_11 = tmp_for_loop_1__iter_value; 559     tmp_assign_source_11 = tmp_for_loop_1__iter_value;
562 560
563     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain_x, tmp_assign_source_11 ); 561     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain_x, tmp_assign_source_11 );
n 564     tmp_compexpr_left_1 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value1 ); n 562     tmp_unused = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value1 );
565 563
n 566     if (unlikely( tmp_compexpr_left_1 == NULL )) n 564     if (unlikely( tmp_unused == NULL ))
567     { 565     {
n 568         tmp_compexpr_left_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value1 ); n 566         tmp_unused = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value1 );
569     } 567     }
570 568
n 571     if ( tmp_compexpr_left_1 == NULL ) n 569     if ( tmp_unused == NULL )
572     { 570     {
573 571
574         exception_type = PyExc_NameError; 572         exception_type = PyExc_NameError;
575         Py_INCREF( exception_type ); 573         Py_INCREF( exception_type );
576         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value1" ); 574         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value1" );
577         exception_tb = NULL; 575         exception_tb = NULL;
578         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); 576         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
579         CHAIN_EXCEPTION( exception_value ); 577         CHAIN_EXCEPTION( exception_value );
580 578
n 581         exception_lineno = 28; n 579         exception_lineno = 30;
582         goto try_except_handler_1; 580         goto try_except_handler_1;
583     } 581     }
584 582
n 585     tmp_compexpr_right_1 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2 ); n 583     tmp_unused = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2 );
586 584
n 587     if (unlikely( tmp_compexpr_right_1 == NULL )) n 585     if (unlikely( tmp_unused == NULL ))
588     { 586     {
n 589         tmp_compexpr_right_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value2 ); n 587         tmp_unused = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value2 );
590     } 588     }
591 589
n 592     if ( tmp_compexpr_right_1 == NULL ) n 590     if ( tmp_unused == NULL )
593     { 591     {
594 592
595         exception_type = PyExc_NameError; 593         exception_type = PyExc_NameError;
596         Py_INCREF( exception_type ); 594         Py_INCREF( exception_type );
597         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value2" ); 595         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value2" );
598         exception_tb = NULL; 596         exception_tb = NULL;
599         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); 597         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
600         CHAIN_EXCEPTION( exception_value ); 598         CHAIN_EXCEPTION( exception_value );
601 599
n 602         exception_lineno = 28; n 600         exception_lineno = 31;
603         goto try_except_handler_1; 601         goto try_except_handler_1;
604     } 602     }
605 603
t 606     tmp_unused = RICH_COMPARE_EQ_NORECURSE( tmp_compexpr_left_1, tmp_compexpr_right_1 ); t
607     if ( tmp_unused == NULL )
608     {
609         assert( ERROR_OCCURRED() );
610  
611         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
612  
613  
614         exception_lineno = 28;
615         goto try_except_handler_1;
616     }
617     Py_DECREF( tmp_unused );
618     if ( CONSIDER_THREADING() == false ) 604     if ( CONSIDER_THREADING() == false )
619     { 605     {
620         assert( ERROR_OCCURRED() ); 606         assert( ERROR_OCCURRED() );
621 607
622         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); 608         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );