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

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

[Octave-bug-tracker] [bug #65060] classdef: extremely slow writing to ar


From: anonymous
Subject: [Octave-bug-tracker] [bug #65060] classdef: extremely slow writing to array properties
Date: Thu, 11 Jan 2024 05:11:06 -0500 (EST)

Follow-up Comment #3, bug#65060 (group octave):

I can confirm the issue. It is related to these lines of code from
libinterp\octave-value\cdef-object.cc:650 :

            octave_value val = prop.get_value (obj, true, "subsasgn");

            std::list<octave_value_list> args (idx);

            args.erase (args.begin ());

            val = val.assign (octave_value::op_asn_eq,
                              type.substr (1), args, rhs);

            if (val.class_name () != "object"
                || ! to_cdef (val).is_handle_object ())
              prop.set_value (obj, val, true, "subsasgn");

            retval = to_ov (obj);


The member function "subsasgn" is implemented as two steps:
1 - Getting the property value that makes a copy of it
2 - Setting to the copy of the property value

It works correctly but is inefficient. In the step 1 a reference to the
property value should be taken.

Another solution is implementing subsasgn as a one step function.


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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