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

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

[Octave-bug-tracker] [bug #44193] whos "elements" count wrong for user-d


From: Dan Sebald
Subject: [Octave-bug-tracker] [bug #44193] whos "elements" count wrong for user-defined class, capacity problem?
Date: Mon, 19 Dec 2016 00:23:36 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0

Follow-up Comment #10, bug #44193 (project octave):

I've confirmed that the scenario I described is what is happening.  That is,
I'll write notes in the code below of what happens with the "x = A(rand(3,4));
whos" command:


      octave_value varval (context_id context = xdefault_context) const
      {
        if (is_global ())
          return symbol_table::global_varval (name);
        else if (is_persistent ())
          return symbol_table::persistent_varval (name);
        else
          {
            if (context == xdefault_context)
              context = active_context ();

            if (context < value_stack.size ())
              return value_stack[context];  // ALWAYS GOES THIS ROUTE
            else
              return octave_value ();  // NEVER GOES THIS ROUTE
          }
      }


I see the the line ALWAYS GOES THIS ROUTE accessed maybe 50 or 60 times with
the command.  (I suppose there are many things in the symbol table beyond the
user's variables.)

Beyond that, I've not looked further, mainly because of the slowness of doing
development when touching any sort of header file.  Takes maybe 20 to 30
minutes to recompile in that case.  These routines longer than a few lines
should not be inline and inside the header file.  Inline routines are for the
case when the cost of jumping (i.e., setting up stack, making the jump, etc.)
is large relative to the length of the routine.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?44193>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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