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

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

[Octave-bug-tracker] [bug #60122] Save and Run in editor does not always


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #60122] Save and Run in editor does not always save
Date: Tue, 11 May 2021 14:20:39 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

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

In comment #5, Rik wrote:


Now, when you go to run a function a second time Octave first looks into it's
cache of parsed code to see if the function exists.  If it does, it then looks
at the timestamp of the m-file and compares it to the recorded timestamp.  If
they are the same, nothing has changed and Octave can go ahead and use the
cached code.  Otherwise, it has to go out to the disk, parse the new code, and
build the internal representation which it then runs.


The check for an out of date file (timestamp of file, obtained using a stat(2)
call) only happens if Octave has returned to the command prompt for input
since the last time the file timestamp was checked.  If you are just using the
GUI editor and the "run" button there to save and execute a script, then the
prompt timestamp won't be changing, so Octave won't actually check the
timestamp on the file itself.

We added this check on the timestamp to avoid slowing down the interpreter
while it was just running code.  You don't want to be  calling stat every time
a function is executed.

We also rejected the option of scanning the function table and loadpath at
each prompt, or on demand as needed at other locations in the interpreter. 
Though this solution seems simple, it could make the action of issuing the
prompt appear quite sluggish if the loadpath contained network drives or large
directories.

Is there a better way?

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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