Construct RichComparisonStrings

Performance Diagrams

Construct RichComparisonStrings 0010000001000000200000020000003000000300000040000004000000CPython 2.7Nuitka (historic)Nuitka (master)Nuitka (develop)Nuitka (factory)475472274.3076923076923257.0CPython 2.73803690198.15384615384616306.4276297250478Nuitka (historic)4000761322.0296.1853324968316Nuitka (master)3999976445.8461538461538296.2261310076432Nuitka (develop)4000443569.6923076923077296.20185979165717Nuitka (factory)Construct RichComparisonStringsTicks Construct RichComparisonStrings 001000000100000020000002000000300000030000004000000400000050000005000000600000060000007000000700000080000008000000CPython 3.5Nuitka (historic)Nuitka (master)Nuitka (develop)Nuitka (factory)859807474.3076923076923257.0CPython 3.50198.15384615384616504.11538461538464Nuitka (historic)6549551322.0315.8761563390199Nuitka (master)6548771445.8461538461538315.89857415026455Nuitka (develop)6549464569.6923076923077315.87865678719714Nuitka (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
300     PyObject *tmp_assign_source_11; 300     PyObject *tmp_assign_source_11;
301     PyObject *tmp_called_name_1; 301     PyObject *tmp_called_name_1;
302     int tmp_cmp_Lt_1; 302     int tmp_cmp_Lt_1;
303     PyObject *tmp_compare_left_1; 303     PyObject *tmp_compare_left_1;
304     PyObject *tmp_compare_right_1; 304     PyObject *tmp_compare_right_1;
n 305     PyObject *tmp_compexpr_left_1; n
306     PyObject *tmp_compexpr_right_1;
307     PyObject *tmp_fromlist_name_1; 305     PyObject *tmp_fromlist_name_1;
308     PyObject *tmp_globals_name_1; 306     PyObject *tmp_globals_name_1;
309     PyObject *tmp_int_arg_1; 307     PyObject *tmp_int_arg_1;
310     PyObject *tmp_iter_arg_1; 308     PyObject *tmp_iter_arg_1;
311     PyObject *tmp_len_arg_1; 309     PyObject *tmp_len_arg_1;
568     } 566     }
569 567
570     tmp_assign_source_11 = tmp_for_loop_1__iter_value; 568     tmp_assign_source_11 = tmp_for_loop_1__iter_value;
571 569
572     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain_x, tmp_assign_source_11 ); 570     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain_x, tmp_assign_source_11 );
n 573     tmp_compexpr_left_1 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value1 ); n 571     tmp_unused = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value1 );
574 572
n 575     if (unlikely( tmp_compexpr_left_1 == NULL )) n 573     if (unlikely( tmp_unused == NULL ))
576     { 574     {
n 577         tmp_compexpr_left_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value1 ); n 575         tmp_unused = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value1 );
578     } 576     }
579 577
n 580     if ( tmp_compexpr_left_1 == NULL ) n 578     if ( tmp_unused == NULL )
581     { 579     {
582 580
583         exception_type = PyExc_NameError; 581         exception_type = PyExc_NameError;
584         Py_INCREF( exception_type ); 582         Py_INCREF( exception_type );
585         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value1" ); 583         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value1" );
586         exception_tb = NULL; 584         exception_tb = NULL;
587         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); 585         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
588         CHAIN_EXCEPTION( exception_value ); 586         CHAIN_EXCEPTION( exception_value );
589 587
n 590         exception_lineno = 28; n 588         exception_lineno = 30;
591 589
592         goto try_except_handler_1; 590         goto try_except_handler_1;
593     } 591     }
594 592
n 595     tmp_compexpr_right_1 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2 ); n 593     tmp_unused = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2 );
596 594
n 597     if (unlikely( tmp_compexpr_right_1 == NULL )) n 595     if (unlikely( tmp_unused == NULL ))
598     { 596     {
n 599         tmp_compexpr_right_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value2 ); n 597         tmp_unused = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value2 );
600     } 598     }
601 599
n 602     if ( tmp_compexpr_right_1 == NULL ) n 600     if ( tmp_unused == NULL )
603     { 601     {
604 602
605         exception_type = PyExc_NameError; 603         exception_type = PyExc_NameError;
606         Py_INCREF( exception_type ); 604         Py_INCREF( exception_type );
607         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value2" ); 605         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value2" );
608         exception_tb = NULL; 606         exception_tb = NULL;
609         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); 607         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
610         CHAIN_EXCEPTION( exception_value ); 608         CHAIN_EXCEPTION( exception_value );
611 609
n 612         exception_lineno = 28; n 610         exception_lineno = 31;
613 611
614         goto try_except_handler_1; 612         goto try_except_handler_1;
615     } 613     }
616 614
t 617     tmp_unused = RICH_COMPARE_EQ_NORECURSE( tmp_compexpr_left_1, tmp_compexpr_right_1 ); t
618     if ( tmp_unused == NULL )
619     {
620         assert( ERROR_OCCURRED() );
621  
622         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
623  
624  
625         exception_lineno = 28;
626  
627         goto try_except_handler_1;
628     }
629     Py_DECREF( tmp_unused );
630     if ( CONSIDER_THREADING() == false ) 615     if ( CONSIDER_THREADING() == false )
631     { 616     {
632         assert( ERROR_OCCURRED() ); 617         assert( ERROR_OCCURRED() );
633 618
634         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); 619         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );