octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #56752] Performance slowdown from version 3.2.


From: Rik
Subject: [Octave-bug-tracker] [bug #56752] Performance slowdown from version 3.2.4 through to current dev branch
Date: Fri, 16 Aug 2019 17:14:19 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

Follow-up Comment #27, bug #56752 (project octave):

I am now using bm.assign.m for profiling.  It is even simpler which I think is
required to see what is happening.  The file was attached to this report
earlier, but for reference it is:


runs = 5;

cumulate = 0; b = 0; z = 0;
for i = 1:runs
  b = zeros (620, 620);
  tic;
    for j = 1:620
      for k = 1:620
        z = 13;
      end
    end
  timing = toc;
  cumulate = cumulate + timing;
end

## Total time
cumulate


I can see the three for loops in the resulting profile


     88.26% octave::tree_evaluator::visit_simple_for_command
        octave::tree_evaluator::visit_statement_list
      - octave::tree_evaluator::visit_statement
         - 88.23% octave::tree_evaluator::visit_simple_for_command
            - 88.21% octave::tree_evaluator::visit_statement_list
               - octave::tree_evaluator::visit_statement
                  - 87.94% octave::tree_evaluator::visit_simple_for_command
                     - 84.74% octave::tree_evaluator::visit_statement_list
                        - 84.28% octave::tree_evaluator::visit_statement
                           - 83.42% octave::tree_evaluator::evaluate
                              - 80.83%
octave::tree_evaluator::evaluate_internal
                                 - 78.06%
octave::tree_evaluator::visit_simple_assignment
                                    - 44.86%
octave::tree_index_expression::lvalue
                                       - 30.16%
octave::tree_evaluator::convert_to_const_vector
                                          + 16.55%
octave::tree_evaluator::evaluate
                                          + 2.76%
octave_value_list::octave_value_list
                                            2.03%
octave_value_list::octave_value_list
                                            1.74%
std::__cxx11::_List_base<octave_value_list, std::allocator<octave_value_list>
>::_M_clear
                                            1.36%
Array<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> > >::~Array
                                            0.79% std::vector<octave_value,
std::allocator<octave_value> >::vector
                                            0.67% std::vector<octave_value,
std::allocator<octave_value> >::~vector
                                            0.55% octave_value::~octave_value
                                       + 2.18%
octave::octave_lvalue::set_index
                                         1.37% octave_value::~octave_value
                                         1.26%
std::__cxx11::_List_base<octave_value_list, std::allocator<octave_value_list>
>::_M_clear
                                         0.73% octave::octave_lvalue::value
                                         0.62% std::vector<octave_value,
std::allocator<octave_value> >::operator=
                                         0.59%
octave::tree_identifier::lvalue
                                    - 16.15% octave::octave_lvalue::assign
                                       - 15.40% octave_value::assign
                                          - 14.41% octave_value::subsasgn
                                             - 14.05%
octave_base_matrix<NDArray>::subsasgn
                                                - 12.12%
octave_base_value::numeric_assign
                                                   + 6.83%
oct_assignop_assign
                                                     1.09% __strlen_avx2
                                                     1.00%
octave::type_info::lookup_assign_op
                                                     0.51%
octave_value::~octave_value
                                                  0.52%
octave_value::operator=
                                    - 5.99% octave::tree_evaluator::evaluate
                                       - 2.88%
octave::tree_evaluator::evaluate_internal
                                            1.08%
octave::tree_evaluator::visit_constant
                                            0.65%
octave::action_container::run
                                         1.09% octave_value::operator=
                                    + 1.81%
std::__cxx11::_List_base<octave::octave_lvalue,
std::allocator<octave::octave_lvalue> >::_M_clear
                                    + 1.43%
octave::octave_lvalue::~octave_lvalue
                                      1.08% octave_value::operator=
                                      0.78% octave::action_container::run
                                      0.58% octave_value::~octave_value
                                   0.68% octave::action_container::run
                                0.88% octave_value::operator=
                     - 2.37% octave::octave_lvalue::assign
                          0.72% octave::script_stack_frame::varref


I can only identify one point where the string_vector private data member of
octave_value_list makes an appearance and it is only 1.36% so not overly
large.  There are still slow downs with octave_value caused by the locking. 
This sometimes bleeds over in to octave_value_list.  For example, this line


0.62% std::vector<octave_value, std::allocator<octave_value> >::operator=


when probed shows that the actual delay is in the atomic lock of the copy
constructor of octave_value.  The same thing seems to be happening when
octave_value_lists are destroyed or cleared. The actual slowdown is still the
atomic locks. 


1.26% std::__cxx11::_List_base<octave_value_list,
std::allocator<octave_value_list> >::_M_clear
0.67% std::vector<octave_value, std::allocator<octave_value> >::~vector




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?56752>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]