Hi,
When I launch "Run" in my Powershell Form, it take about 1 minute before it actually launches. Doesn't look that long, but it does, first thought it was broken.
Can't see anywhere why it loads that long, when I build the exe and launch that, it takes 2 seconds.
Where can I find out why the run takes this much time?
S
Running project takes 1 minute
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
-
- Posts: 14676
- Joined: Tue May 22, 2007 9:57 am
- Has voted: 1 time
- Been upvoted: 5 times
- Contact:
Re: Running project takes 1 minute
What is "launch run". What code is that. Do you mean "Start-Process" or are you trying to use the old "Shell Run" command?
Re: Running project takes 1 minute
There is a green button (triangle) in the PS Studio menu (ribbon) which says 'Run', when I'm pressing that, it takes a minute for the form to load.
When I go to the Deploy tab in that same ribbon, and click build & run or Run, it loads in seconds.
When I go to the Deploy tab in that same ribbon, and click build & run or Run, it loads in seconds.
-
- Posts: 14676
- Joined: Tue May 22, 2007 9:57 am
- Has voted: 1 time
- Been upvoted: 5 times
- Contact:
Re: Running project takes 1 minute
When running from the menu the system loads the code analyzer and analyzes the code before running. With build and run the code analyzer is not run and the exe is just generated and execute. This is normal. You can turn of the code analyzer on the options page. The script analyzer should be reviewed as it will tell you where your code can be improved and gives good statistics on the script design, The default also runs the performance analyzer which also takes time to load. If your script is long and has many issues with style, structure and definition the script analyzer could take quite a while to complete the analysis and output the report.
I highly recommend posting product issues in the Sapien product support forum. They will be able to give you more current and complete answers as they work with these issues daily and are also a team that can find the best answers for product issues. This forum is mostly for questions about the technology of forms use with PowerShell.
I highly recommend posting product issues in the Sapien product support forum. They will be able to give you more current and complete answers as they work with these issues daily and are also a team that can find the best answers for product issues. This forum is mostly for questions about the technology of forms use with PowerShell.
Re: Running project takes 1 minute
Thanks. Can you tell me
>You can turn of the code analyzer on the options page. The script analyzer should be reviewed
where I can turn off the code analyzer? I can't find it in the options page or is it "Enable automatic syntax checking" in Editor Settings on option page?
>You can turn of the code analyzer on the options page. The script analyzer should be reviewed
where I can turn off the code analyzer? I can't find it in the options page or is it "Enable automatic syntax checking" in Editor Settings on option page?
Re: Running project takes 1 minute
Thanks, but disabling that didn't help. Still takes long time (little bit less now).
I do think it was a setting I changed though. One day it was working fine (started in seconds), next day it takes a minute.
I do think it was a setting I changed though. One day it was working fine (started in seconds), next day it takes a minute.
-
- Posts: 14676
- Joined: Tue May 22, 2007 9:57 am
- Has voted: 1 time
- Been upvoted: 5 times
- Contact:
-
- Posts: 14676
- Joined: Tue May 22, 2007 9:57 am
- Has voted: 1 time
- Been upvoted: 5 times
- Contact:
Re: Running project takes 1 minute
The form is PowerShell. It is PowerShell that is loading the form.
Anything in the "Load" event will prevent the form from displaying until the load event terminates. What are you doing in the load event? Run the PS1 in the console and see if it loads any faster. If the load event is taking too much time then the form will not display. The form only displays after the load event ends. Any code running outside of an event will also stop the form from displaying until it is done executing. In a project, any code running in "startup.pss" or "globals.ps1" will also prevent the form from displaying.
It i almost always the case that a slow form is caused by incorrect program design. This is true of all languages that display a form and is true on non-Windows systems form mainframes to Unix to Macs.
Anything in the "Load" event will prevent the form from displaying until the load event terminates. What are you doing in the load event? Run the PS1 in the console and see if it loads any faster. If the load event is taking too much time then the form will not display. The form only displays after the load event ends. Any code running outside of an event will also stop the form from displaying until it is done executing. In a project, any code running in "startup.pss" or "globals.ps1" will also prevent the form from displaying.
It i almost always the case that a slow form is caused by incorrect program design. This is true of all languages that display a form and is true on non-Windows systems form mainframes to Unix to Macs.