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, 13 Sep 2019 13:05:37 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

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

Regarding NoAlias, the number of instances where it is used is quite small: 9
in liboctave and 14 in libinterp.

Speaking personally, I find the pattern of using a function (xelem) rather
than subclassing an object (NoAlias) easier to understand.

jwe has proposed two replacements for NoAlias: 1) using 'const' objects when
read-only access is all that is necessary, 2) using xelem when it is desired
to write elements without causing a check on reference count and possibly
uniquifying the Array.

@jwe: Is that an accurate summary?  Is the existing Array class set up
correctly so that if I use a const constructor I don't end up with two actual
arrays as shown below?


 const ArrayType new_ro_array (existing_array);
 ... intervening code ...
 T element1 = new_ro_array(1);  // Will call new_ro_array.elem()
                                // No problem?


If yes, then I would advocate eliminating NoAlias for readability.


    _______________________________________________________

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]