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

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

Just checked in two small changes to the new octave_value_list implementation
at https://hg.savannah.gnu.org/hgweb/octave/rev/254d6e33a1d0.

In the first change, I took advantage of the range constructor for std::vector
to make the variable argument template constructor simpler.


   template<template <typename...> class OV_Container>
   octave_value_list (const OV_Container<octave_value>& args)
-    : m_data (args.size ()), m_names ()
-  {
-    auto p = args.begin ();
-
-    for (size_t i = 0; i < m_data.size (); i++)
-      m_data[i] = *p++;
-  }
+    : m_data (args.begin (), args.end ()), m_names () { }


Second change was just about readability.  As with the octave m-file language,
Ifind it more readable to test on empty() rather than on numel > 0.


-    if (m_data.size () > 0)
+    if (! m_data.empty ())




    _______________________________________________________

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]