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 12:07:11 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

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

I could see the string_vector object being created in the profiling reports. 
It didn't look like it was a big time sink because, as you note, it is almost
never used.

But, we should optimize for the most common code path.  If it is used only 1%
of the time then we should default the code to using the path that is taken
99% of the time and special case this 1% path.

Since names is a private data member of the octave_value_list class it should
be possible to change the underlying implementation without any caller
noticing.

First idea, can it be eliminated completely?  Biggest savings and also makes
the class easier to understand.

Second idea, if it can't be eliminated, change the declaration to be a pointer
to a string_vector.  For most invocations of the octave_value_list class this
will merely require the creation of a NULL pointer which is fast and takes
very little memory.  The routines that do make use of it would need to be
updated to refer to a pointer, but that would be easy.  For example


  string_vector name_tags (void) const { return names; }


goes to


  string_vector name_tags (void) const { return *names; }




    _______________________________________________________

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]