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)4000168569.6923076923077296.21615226359756Nuitka (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)6549321445.8461538461538315.88276671925865Nuitka (develop)6552135569.6923076923077315.80189015407586Nuitka (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;
560     } 558     }
561 559
562     tmp_assign_source_11 = tmp_for_loop_1__iter_value; 560     tmp_assign_source_11 = tmp_for_loop_1__iter_value;
563 561
564     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain_x, tmp_assign_source_11 ); 562     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain_x, tmp_assign_source_11 );
n 565     tmp_compexpr_left_1 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value1 ); n 563     tmp_unused = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value1 );
566 564
n 567     if (unlikely( tmp_compexpr_left_1 == NULL )) n 565     if (unlikely( tmp_unused == NULL ))
568     { 566     {
n 569         tmp_compexpr_left_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value1 ); n 567         tmp_unused = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value1 );
570     } 568     }
571 569
n 572     if ( tmp_compexpr_left_1 == NULL ) n 570     if ( tmp_unused == NULL )
573     { 571     {
574 572
575         exception_type = PyExc_NameError; 573         exception_type = PyExc_NameError;
576         Py_INCREF( exception_type ); 574         Py_INCREF( exception_type );
577         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value1" ); 575         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value1" );
578         exception_tb = NULL; 576         exception_tb = NULL;
579         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); 577         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
580         CHAIN_EXCEPTION( exception_value ); 578         CHAIN_EXCEPTION( exception_value );
581 579
n 582         exception_lineno = 28; n 580         exception_lineno = 30;
583         goto try_except_handler_1; 581         goto try_except_handler_1;
584     } 582     }
585 583
n 586     tmp_compexpr_right_1 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2 ); n 584     tmp_unused = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2 );
587 585
n 588     if (unlikely( tmp_compexpr_right_1 == NULL )) n 586     if (unlikely( tmp_unused == NULL ))
589     { 587     {
n 590         tmp_compexpr_right_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value2 ); n 588         tmp_unused = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value2 );
591     } 589     }
592 590
n 593     if ( tmp_compexpr_right_1 == NULL ) n 591     if ( tmp_unused == NULL )
594     { 592     {
595 593
596         exception_type = PyExc_NameError; 594         exception_type = PyExc_NameError;
597         Py_INCREF( exception_type ); 595         Py_INCREF( exception_type );
598         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value2" ); 596         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value2" );
599         exception_tb = NULL; 597         exception_tb = NULL;
600         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); 598         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
601         CHAIN_EXCEPTION( exception_value ); 599         CHAIN_EXCEPTION( exception_value );
602 600
n 603         exception_lineno = 28; n 601         exception_lineno = 31;
604         goto try_except_handler_1; 602         goto try_except_handler_1;
605     } 603     }
606 604
t 607     tmp_unused = RICH_COMPARE_EQ_NORECURSE( tmp_compexpr_left_1, tmp_compexpr_right_1 ); t
608     if ( tmp_unused == NULL )
609     {
610         assert( ERROR_OCCURRED() );
611  
612         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
613  
614  
615         exception_lineno = 28;
616         goto try_except_handler_1;
617     }
618     Py_DECREF( tmp_unused );
619     if ( CONSIDER_THREADING() == false ) 605     if ( CONSIDER_THREADING() == false )
620     { 606     {
621         assert( ERROR_OCCURRED() ); 607         assert( ERROR_OCCURRED() );
622 608
623         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); 609         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );