Go to card has become slow

Richard Gaskin ambassador at fourthworld.com
Mon Apr 6 14:07:44 EDT 2020


Bob Sneidar wrote:

 > On Apr 6, 2020, at 9:28 AM, Richard Gaskin wrote:
 >
 >> Your application writing data to disk is a very different thing from
 >> Windows Desktop Explorer automatically refreshing a directory view.
 >
 > Control doesn’t return to the application until the tilde version goes
 > away.

True, but LC is done with that tilde file and deletes it LONG before the 
separate process of the Windows File Explorer polls and redraws the 
graphical illustration of the deletion that has already happened.


 > On Apr 6, 2020, at 9:28 AM, Richard Gaskin wrote:
 >
 >> on mouseUp
 >>  put the long seconds into t
 >>  write "somedata" to url ("file:whatever")
 >>  if the result is not empty then
 >>     answer "Couldn't write file (" &sysError()&")"
 >>    exit to top
 >>  end if
 >>  put the long seconds - t
 >> end mouseUp
 >
 > You are testing low level file operations. I am testing the saving of
 > a Livecode stack. I don’t think this test applies.

Comforting to know that there is no perceived difference in generic file 
writes between Mac and Win, and that we can focus exclusively on the 
small handful of additional steps LC takes when saving a stack file.

This is my understanding of the steps LC takes to save a stack file 
(hopefully Mark Waddingham will chime in if any of this is incorrect or 
incomplete), where "*" denotes steps unique to stack files not taken 
with other files:

* 1. Serialize stack data
* 2. If file exists, rename it with tilde
   3. Open the file
   4. Write the data to disk
   5. Close the file
* 6. Delete the tilde'd file


This test will measure that:

on mouseUp
   put the long seconds into t
   save this stack
   put the long seconds - t
end mouseUp


If the stack contains little data, as with other benchmarking you may 
need to put the task in a loop in between the timing statements to have 
a duration long enough to be meaningfully measurable, e.g.:

on mouseUp
   put the long seconds into t
   repeat 100
      save this stack
   end repeat
   put the long seconds - t
end mouseUp

Run that on similar Mac and Win iron and let us know how it goes.

-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com





More information about the use-livecode mailing list