Windows Standalone Performance

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Windows Standalone Performance

Bob Sneidar via use-livecode
Hi all.

Just wanted to give a heads up on what I think is the greatest Windows Standalone performance killer.

When I first began to develop, it was done entirely on a Mac, and before I had any thought about how a standalone would work in a multiuser environment. As such, it was easy for me to simply save anything I wanted to persist between sessions as aomething in the stack, a settings card at first, then later as properties of each stack and the main stack. To ensure that these properties persisted I saved each sub stack when I updated any of those properties.

On a Mac, for whatever reason, the performance hit was insignificant. On WINDOWS however, it became painfully clear to me that the performance penalty was VERY substantial! I can watch the folder containing the standalone stacks, see the temp files being created, one mississippi, two mississippi, three mississippi, around 4 misssissippi the temp file goes away.

Since I do a lot of setup, I was saving the stack(s) multiple times just launching the app! And it was killing the performance. After putting in the condition not (the platform contains "WIN") before my save statements, performance, while not up to snuff compared to the MacOS, is actually quite acceptable.

If you are saving your stacks by script when opening and closing, and you are experiencing long delays, consider going a different route. In fact, consider moving all your "settings" and persistent data to a memory array or database, and then writing it to disk either occassionally during idle time, or on quit.

Bob S


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Windows Standalone Performance

Bob Sneidar via use-livecode

Bob:

 > Since I do a lot of setup, I was saving the stack(s) multiple
 > times just launching the app! And it was killing the performance.

Behold the antivirus. One more reason to code with care....

This time it did you a favor; these habits add up to hurt Mac apps too.

Best wishes,

Curry Kenworthy

Custom Software Development
"Better Methods, Better Results"
LiveCode Training and Consulting
http://livecodeconsulting.com/

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Windows Standalone Performance

Bob Sneidar via use-livecode
In reply to this post by Bob Sneidar via use-livecode
Bob Sneidar wrote:

 > Just wanted to give a heads up on what I think is the greatest Windows
 > Standalone performance killer.
..
 > On a Mac, for whatever reason, the performance hit was insignificant.
 > On WINDOWS however, it became painfully clear to me that the
 > performance penalty was VERY substantial! I can watch the folder
 > containing the standalone stacks, see the temp files being created,
 > one mississippi, two mississippi, three mississippi, around 4
 > misssissippi the temp file goes away.

Assuming similar storage specs, it may be that Windows is inherently
slower than Unix (possibly), or maybe LC less optimized there (likely).

But such a dramatic difference with that specific evidence merits
another test.

Windows Explorer definitely has a longer default period between
automatic directory listings than the macOS Finder.  You can see it in
many contexts.

Maybe better would be to set the cursor to watch on save, and time that.

Better still might be to time the milliseconds from the beginning of the
save until after the OS returns control to your script when it's done.

I suspect you'll still see a difference, but not nearly as dramatic as
the slower refresh rates in the file manager UI.

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


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Windows Standalone Performance

Bob Sneidar via use-livecode
In reply to this post by Bob Sneidar via use-livecode
Easy enough to test. I'll do that later and get back with results. It's definitely worth exploring, but I can short cut that a bit by saying that since virtually everyone with any sense has some kind of protection, even if it's Windows Defender, but also other protection on top of that, the exercise is somewhat academic. No one is going to turn off their file AV and simply trusting the app may not be enough to disable file checking operations.

Bob S


> On Dec 10, 2019, at 18:29 , Curry Kenworthy via use-livecode <[hidden email]> wrote:
>
>
> Bob:
>
> > Since I do a lot of setup, I was saving the stack(s) multiple
> > times just launching the app! And it was killing the performance.
>
> Behold the antivirus. One more reason to code with care....
>
> This time it did you a favor; these habits add up to hurt Mac apps too.
>
> Best wishes,
>
> Curry Kenworthy
>
> Custom Software Development
> "Better Methods, Better Results"
> LiveCode Training and Consulting
> http://livecodeconsulting.com/
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Windows Standalone Performance

Bob Sneidar via use-livecode

 > No one is going to turn off their file AV

LOL - yes, but that would be entirely your idea, not mine.

As I said, yet another reason to code with care.

Saving a stack multiple times while launching is not a good habit. Bad
habits add up to hurt Mac apps too.

The AV did you a favor with exaggerated symptoms to highlight that
weakness in your code. Not just a Windows problem. If you applied the
fix for all platforms, you now have better Mac code too.

Best wishes,

Curry Kenworthy

Custom Software Development
"Better Methods, Better Results"
LiveCode Training and Consulting
http://livecodeconsulting.com/

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Windows Standalone Performance

Bob Sneidar via use-livecode
I like that. Looking on the bright side. :-) And of course you are right, saving multiple times is not a good thing, but I did this back when we had that bug where saving scripts actually didn't for whatever reason, and I had some crash to desktop issues as well, prompting me to insert an auto save whenever a stack was closed.

We are past that now, so I am going through my code and removing all that, saving prefs when I close the app, and when making changes to the settings, and at no other time.

Bob S


> On Dec 11, 2019, at 12:13 , Curry Kenworthy via use-livecode <[hidden email]> wrote:
>
> > No one is going to turn off their file AV
>
> LOL - yes, but that would be entirely your idea, not mine.
>
> As I said, yet another reason to code with care.
>
> Saving a stack multiple times while launching is not a good habit. Bad habits add up to hurt Mac apps too.
>
> The AV did you a favor with exaggerated symptoms to highlight that weakness in your code. Not just a Windows problem. If you applied the fix for all platforms, you now have better Mac code too.


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Windows Standalone Performance

Bob Sneidar via use-livecode
In reply to this post by Bob Sneidar via use-livecode
This bug was reported some time ago https://quality.livecode.com/show_bug.cgi?id=21305 <https://quality.livecode.com/show_bug.cgi?id=21305>

Saving a 9 megabyte stack in Windows 10 can take 10 seconds or more.

It is not caused by Windows Defender or anti-virus software.
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Windows Standalone Performance

Bob Sneidar via use-livecode
Hi Neville

From my stance I have never seen this behaviour for any version of LC from any stack ide or standalone on Mac, Windows XP/7/8/10 native or via ParallelsDesktop. Perhaps you could do a few screen recordings using an external device like your phone and show the task manager reporting drive activity and processor activity. This would give a better understanding or your case scenario.

All the best.  

Sean Cole
Pi Digital Prod Ltd

> On 12 Dec 2019, at 00:33, Neville via use-livecode <[hidden email]> wrote:
>
> This bug was reported some time ago https://quality.livecode.com/show_bug.cgi?id=21305 <https://quality.livecode.com/show_bug.cgi?id=21305>
>
> Saving a 9 megabyte stack in Windows 10 can take 10 seconds or more.
>
> It is not caused by Windows Defender or anti-virus software.
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: windows standalone performance

Bob Sneidar via use-livecode
In reply to this post by Bob Sneidar via use-livecode
Hi Sean

The slow saving of stacks under LC9 occurs in Windows 10, native and using Parallels Desktop.
https://quality.livecode.com/show_bug.cgi?id=21305 <https://quality.livecode.com/show_bug.cgi?id=21305>

Mac, Linux and previous versions of Windows are not affected.

The bug was confirmed by Quality Control although not initially; so  it is evidently related to some particular configuration of Windows 10 - although my Mac Parallels setup is out-of-the-box as was the native Windows machine of the user who reported it to me. It is not affected by turning off Windows Defender and AV software. There is nothing special I can think of for the particular stack being saved (except it is large, to demonstrate the saving speed); the example stack is in the bug report. When the "save stack” handler activates you can see the temporary file created on the desktop of Explorer immediately, but then a long wait for the file write to complete.

Saving a file from LC, rather than a stack, is not any slower than for other Windows apps (so sqlite performance is presumably not affected).

Neville
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: windows standalone performance

Bob Sneidar via use-livecode
From what I can tell from QC is that it has not been confirmed and been marked as pending due to not being able to reproduce. Therefore the report is in limbo until further evidence or successful, consistent reproduction can be displayed.

Hence, if you make a video of your findings it makes it easier for us to see your specific findings and external system conditions. That may well help us find out what causes the hang or lag.

All the best.

Sean Cole
Pi Digital Prod Ltd

> On 13 Dec 2019, at 01:23, Neville via use-livecode <[hidden email]> wrote:
>
> Hi Sean
>
> The slow saving of stacks under LC9 occurs in Windows 10, native and using Parallels Desktop.
> https://quality.livecode.com/show_bug.cgi?id=21305 <https://quality.livecode.com/show_bug.cgi?id=21305>
>
> Mac, Linux and previous versions of Windows are not affected.
>
> The bug was confirmed by Quality Control although not initially; so  it is evidently related to some particular configuration of Windows 10 - although my Mac Parallels setup is out-of-the-box as was the native Windows machine of the user who reported it to me. It is not affected by turning off Windows Defender and AV software. There is nothing special I can think of for the particular stack being saved (except it is large, to demonstrate the saving speed); the example stack is in the bug report. When the "save stack” handler activates you can see the temporary file created on the desktop of Explorer immediately, but then a long wait for the file write to complete.
>
> Saving a file from LC, rather than a stack, is not any slower than for other Windows apps (so sqlite performance is presumably not affected).
>
> Neville
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: windows standalone performance

Bob Sneidar via use-livecode
In reply to this post by Bob Sneidar via use-livecode
> Sean wrote: From what I can tell from QC is that it has not been confirmed and been marked as pending due to not being able to reproduce.

The bug is clearly marked as status CONFIRMED.

There was a stage when QC could not reproduce the bug on their machines, but Panos did confirm it “on older machines”. Brian Milby has also seen the bug, as well as of course our latest correspondent.

I have just confirmed the bug still exists under LC9.5.1, in both standalone and the IDE, in Parallels Desktop on a Mac Pro running the latest Windows 10, typically taking 7 seconds to save a 8MB stack — of course that is emulating the OS but I believe speeds on native hardware are comparable (or worse).  

My user who initially reported the bug to me has acquired a new PC on which the bug does not seem to happen (tho’ it is a blindingly fast machine!) so as most of my users are Mac people I lost interest in the bug until this discussion. Not being a Windows user myself I am not going to research the actual processes and cannot assess on what hardware configuration the bug occurs --- clearly not all PC’s are affected.

If you want to test on your own PC a test stack (actually a wrapper standalone slowSave.app and a data stack data.livecode, together with the source slowSave.livecode) can be downloaded from

https://www.dropbox.com/sh/cb2r9jbohxqv6bp/AAAQ1weLLlzrKYQ21yn1apf9a?dl=0 <https://www.dropbox.com/sh/cb2r9jbohxqv6bp/AAAQ1weLLlzrKYQ21yn1apf9a?dl=0>




_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: windows standalone performance

Bob Sneidar via use-livecode
In reply to this post by Bob Sneidar via use-livecode
> My user who initially reported the bug to me has acquired a new PC on which the bug does not seem to happen

I spoke too soon … my user's whiz-bang PC still takes 3 seconds to save my app's 9 MB data stack, when his older PC takes 10 seconds. Both should be saving in a very small fraction of a second.


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode