PrimalScript is SLOW on Windows 10 Enterprise

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 2 years and 3 weeks old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
FrankAndrew
Posts: 164
Last visit: Sat Apr 01, 2023 1:52 am

PrimalScript is SLOW on Windows 10 Enterprise

Post by FrankAndrew »

Product, version and build: 8.0.157
Operating system: Windows 10 Enterprise Version 20H2 (Build 19042.1415)
PowerShell version(s): 5.1

Hi Everyone,

It has been a long time since I reported a problem with PrimalScript.

I have noticed over the last year or so when I start PrimalScript on my Windows 10 at work that it is VERY SLUGISH.
In the title I am seeing the (Not responding) message way too many times.

Now that I am trying to debug a script that I wrote three years ago to improve it, PrimalScript is WAY TO SLOW responding to steps that used to fly quickly.
It is VERY PAINFUL to use PrimalScript right now :-( WAY TO SLOW!

What do you need from me in order to fix this problem or to see what is causing it?
My PowerShell Studio does NOT have this problem AT ALL. Nor do any of the other SAPIEN Products that I have just PrimalScript.
User avatar
FrankAndrew
Posts: 164
Last visit: Sat Apr 01, 2023 1:52 am

Re: PrimalScript is SLOW on Windows 10 Enterprise

Post by FrankAndrew »

After trying to use PS it is a HUGE PAIN IN THE BUTT right now.
It does NOT matter how large or small the vbs script is that is in the editor!
I don't know what you guys are doing in the background but it is TOTALLY SLOWING DOWN PS!

The color coding of the script variables is also going away during these "On the blink" episodes. Even just trying to scroll up or down through the code is a HUGE PAIN.
Trying to use PS right now is almost impossible! I am sad :-( :-( VERY SAD!
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: PrimalScript is SLOW on Windows 10 Enterprise

Post by Alexander Riedel »

Hi Frank. I can imagine, like with any software, when things slow down, it gets a bit frustrating. Let's skip the use of all caps though, please.
As you may imagine, anything concerning VBScript is quite static and has been for years. So there is not really anything we do in the background other than parse your code.
It is unfortunate that you did not report this when it happened first, so it is somewhat impossible now to tie it to a specific version or a feature that was introduced.
I ran a quick test here and could find no indication of any performance problem.

There are very few things that could cause the coloring to "go away". I am not sure what that means, but we look into it.
Please verify with the Process Explorer what CPU percentage PrimalScript uses when it's marked a "not responding". That way we can be sure it is the PrimalScript process and not something secondary.
Secondly, please give us some indication as to what size script you consider small or large. That is quite individual. As always, if you can send us an actual problem script, that would help.
Thirdly it would be interesting to know if this phenomenon is solely applying to VBScript or also affects, say, PowerShell files.
Last but not least, if you have the "File Browser" in PrimalScript open, it would be noteworthy how many scripts (all types) and what size they cumulatively are in your current folder.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
FrankAndrew
Posts: 164
Last visit: Sat Apr 01, 2023 1:52 am

Re: PrimalScript is SLOW on Windows 10 Enterprise

Post by FrankAndrew »

Hi Alex,
I apologize for being loud. My bad :-(
The reason that I did not report this earlier is because I used to have 30-40 VB-Script loading everytime I started PS. Something that most users probably don't do. I was also just starting it once after I had updated to the newest version. All of those files are located on a Network Share and always have been as long as I have been using PS approx. 20 years.
I have also not had the need to work on or debug any of my script for the last two years. I have been using PowerShell in your PowerShell Studio now that our company has PowerShell 5.1 available everywhere and as you know that is a much nicer development environment and with PowerShell Studio. So I attributed the slow down to the many scripts that I was loading at start time and then due to this problem I closed them all so that only 1 was in the editor before I tested further. Sorry I did not report this earlier but I did not know it was happening this often.

Using the Resourcemonitor I created two short video watching PrimalScript and having one dialog, the floating output dialog, visible. I took four screenshots, two from each video, that I will upload here.
2021.12.27_PrimalScript_PerformanceProblem.zip
four screenshots of the Resourcemonitor
(1.15 MiB) Downloaded 1128 times
If you want to see the videos let me know where I can upload them.
The problem occurs every 30 seconds regardless if PrimalScript is doing anything or not.

As for script sizes my small script was Test Bubble Sort script of 4,162 bytes with 120 lines.
The large script was a discovery script of 908,204 bytes with 9,671 lines.
But as I said above, now that I was just watching PS it was doing it's thing, whatever it is, every 30 seconds without anything being done in the editor.

This happens with PowerShell scripts as well. It is also happening when no scripts are loaded into the editor, every 30 seconds. Like clock work.

As far as the "File Browser" in PrimalScript is concerned it also locks up in these episodes.
The normal folder where I have it pointing has 420 files and 45 sub-directories.
Once I choose another directory it stays pointed to that most recent one, which may have fewer files and directories in it.

Let me know if you need anything else from me.
Gruß,
Drew
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: PrimalScript is SLOW on Windows 10 Enterprise

Post by Alexander Riedel »

I double checked but there is no timer in PrimalScript or thread wait using 30 seconds. I also do not believe that this is a CPU usage thing, as your screenshots indicate no increased CPU usage for the PrimalScript process when it is shown as unresponsive. Since it is also not language or even open file dependent, the primary parser is not the issue either.
Now, the file browser does periodically check if any files have changed state since last parsed, so it is possible that there is a network timeout hidden here.
I would suggest to try two things.
1. Close the file browser entirely and restart PrimalScript. That should prevent it from even looking.
2. Select a local folder in the file browser, with some small number of scripts in it.

Let me know if that does anything.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
FrankAndrew
Posts: 164
Last visit: Sat Apr 01, 2023 1:52 am

Re: PrimalScript is SLOW on Windows 10 Enterprise

Post by FrankAndrew »

Hi Alex,
The CPU usage does increase for PrimalScript when it goes into this state.
The two idle screenshots show 49% and 54%, when the incident occurs it goes up to 74% and 79%.
As I said before I could upload the two videos and you can watch them yourself.
Each video is about 5MB and is an MP4 file.
I turned off the following things in the PrimalScript option setting and restarted PrimalScript after each change:
Turned Off check remote files option
Turned Off check remote files option
2021.12.29_14-18-48_WEN10459_ap527_turned_off_Check-Remote-Files.png (30.61 KiB) Viewed 36283 times
Turned Off Resume Last* options
Turned Off Resume Last* options
2021.12.29_14-22-25_WEN10459_ap527_turned_off_Resume-Last_options.png (21.7 KiB) Viewed 36283 times
Still no improvement.
I also stopped all of the Windows "File Browsers" that are normally open and restarted PS. Still no improvement.
I also selected a local folder for the PS File Browser and changed the directories in the options to also look at that same local directory. I stopped and restarted PS, no improvement, still every 30 seconds the same thing.
This is only affecting PS nothing else, which is very strange :-(
Any idea where else I can look?
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: PrimalScript is SLOW on Windows 10 Enterprise

Post by Alexander Riedel »

Let's go back to your resource monitor screenshots. Yes, your overall CPU usage goes up. The CPU column and the average CPU for the PrimalScript process are at 1% or 2 % and do not increase when the app seems frozen. I cannot scroll on your screenshot to see which process increases, but it is clearly not PrimalScript, at least not according to your screenshots.
Generally, when a process hangs *without* any CPU usage increase, it is a network or device wait for a timeout.

I will also point out that I am somewhat certain this is a problem within your environment rather than a general PrimalScript problem. Since you said this has happened for a while, you can be sure that if that was a general problem, user in the forum would have let us know. Maybe they'd even use all caps. :D But this is indeed the first time I hear about this.
That is not to say we do not investigate and do what we can to help you, and in the process make PrimalScript better.

The standard test to determine application versus environment is this:
- Put PrimalScript and your folder of files on another machine in your network. Does it act the same?
- Do this with a machine not in your network, maybe you have a machine at home or a laptop that is not connected. Does it act the same way there too?

This way we know:
a) It is only your machine, we can look for specifics there.
b) It only acts like that in your network, we can talk about changes that may have been applied.
c) It acts like that on all three, then we have more of an application problem and look there.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
FrankAndrew
Posts: 164
Last visit: Sat Apr 01, 2023 1:52 am

Re: PrimalScript is SLOW on Windows 10 Enterprise

Post by FrankAndrew »

I just got through doing some testing with a colleague that works in our Client OS department.
He showed me Process Monitor and how to use it.
We were not able to nail down what is exactly going on here.
So as you suggested I will run PS on other machines that I have to find out is the same thing happening on them at all, which version of PS is running there.
Being as I have the Lab Pack I already have PS installed on several machines and they are currently at different version levels.
Due to Covid I am working from home. As you know I also have a private license for PS maself and I will be testing here on my own machines also.
So that will take a while and we are shortly before the NewYear. I will update this as I have further information but that will stretch into next year.
Thanks for all your help and ideas where to look. We here are also very interested to discover what is causing this because my people have not seen anything like this either.
We're having FUN :-)
The IT never gets boring.
User avatar
FrankAndrew
Posts: 164
Last visit: Sat Apr 01, 2023 1:52 am

Re: PrimalScript is SLOW on Windows 10 Enterprise

Post by FrankAndrew »

Hi, I am back from year end/new years vacation.
I tested further and I have this same condition on another machine here at work but with the PS Version 8.0.155. But on another machine that originally had the PS Version 8.0.155 does not have this condition.
I also had our Virus checker people take a look at these machines and they do not see anything occurring between the virus software and PS.
I have tested this at home on my own Windows 10 machines and have not seen this happen at all.
So as you said from the beginning this cannot be a PS problem and has to be something else at our company that is causing this to happen.
When we find out what it is I will let you know. Until then this incident can be close.
Thanks for checking on your end.
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: PrimalScript is SLOW on Windows 10 Enterprise

Post by Alexander Riedel »

Thanks for the update. I am curious as to what is causing this. If you need any help, please let me know.
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 2 years and 3 weeks old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.