Long time to load form when running it

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 10 years and 2 months 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
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Long time to load form when running it

Post by davidc »

Can you clarify what constitutes not connected to the internet?
For example:

Is this on a machine without a network card?
Is the network card / wireless disabled?
Or a machine connected to a LAN that has no internet access?

We have been unable to reproduce this on our end, therefore we want to test this on a machine that closely mirrors your environment. Please include machine's details such as OS, product version and Powershell version.


David
David
SAPIEN Technologies, Inc.
User avatar
SSC365
Posts: 23
Last visit: Fri Aug 21, 2020 6:26 am

Re: Long time to load form when running it

Post by SSC365 »

Sure:
We have the Powershell Admin Studio on virtual Windows 2008 R2, LAN is a typical server LAN without access to the Internet. We are working with pff, export it to an exe. Powershell V3, STA mode. It takes about 30 seconds and sometimes more for the exe to come up and show the form. No matter if we execute it on this server or on a Citrix TS.
But even when starting the pff in the Powershell admin studio it takes long to come up.
Is there a chance to trace what the app is doing?
Maybe we have a delay elsewhere in the code?

Regards

Robert
User avatar
C3PO_R2D2
Posts: 22
Last visit: Thu Jul 29, 2021 3:55 am

Re: Long time to load form when running it

Post by C3PO_R2D2 »

Here's mine:

I use a Windows Server 2008 R2, and I have the issue on both virtual & physical servers, and with SP1 installed or without it.
These servers have a normal network card, but the there's no access to the Internet, because it's on an isolated network.
I installed Powershell Studio 2012 v3.1.23, and the servers have the Powershell V2 engine (by default). When installing PS2012, I choose the Complete installation.

Robert, when you disable your network card, does it speed up the process?
User avatar
Alexander Riedel
Posts: 8488
Last visit: Tue Apr 16, 2024 8:42 am
Answers: 20
Been upvoted: 37 times

Re: Long time to load form when running it

Post by Alexander Riedel »

Ok, let's try this:
- Build a simple form with just an OK button, nothing else.
- Export to an exe.
- Bring up Task manager
- Launch the exe from Windows Explorer and check the process in
task manager.

If you see heavy disk activity and/or CPU on the process it is loading something that shouldn't normally take that long.
If there is no CPU activity and no disk activity while it sits there we have a network timeout.

Based on that we can check further.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
Alexander Riedel
Posts: 8488
Last visit: Tue Apr 16, 2024 8:42 am
Answers: 20
Been upvoted: 37 times

Re: Long time to load form when running it

Post by Alexander Riedel »

Oh and one further question. Are you digitally signing your executable?
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
C3PO_R2D2
Posts: 22
Last visit: Thu Jul 29, 2021 3:55 am

Re: Long time to load form when running it

Post by C3PO_R2D2 »

Hello,

I did the test:

When I create an exe of the form, the form launches immediately.
When I launch the form within Powershell Studio, it takes like 30 seconds to launch. Looking at CPU, memory & disk, I don't see a difference in these counters.
And I don't sign the scripts...
User avatar
Alexander Riedel
Posts: 8488
Last visit: Tue Apr 16, 2024 8:42 am
Answers: 20
Been upvoted: 37 times

Re: Long time to load form when running it

Post by Alexander Riedel »

Let's wait for Robert to reply. The way I understand his post he observes a delay when launching a script as a packaged exe as well.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
SSC365
Posts: 23
Last visit: Fri Aug 21, 2020 6:26 am

Re: Long time to load form when running it

Post by SSC365 »

I want to give an update here:
After some step-by-step investigation of our script code, we arranged the logic in a way that we first load and present the form. After the form is loaded (which starts with presenting an HTML page with Information for the user) some backend functionality is triggered (finding the closest domain Controller, connect to Exchange).
That means the time the user Needs to select the proper button to proceed in the form is used to run additional code in the Background which is not necessarily to have ready when starting the form.
This helped out to start completely without delay which was formerly caused by first running all background code and then displaying the form.
The reason why the delay in our DEV envrionment was almost 0 and in production 50 seconds was just related to the much much bigger Active Directory, Exchange and Network structures in production.
Finally we cannot see a delay by loading the same form in dev console or as packaged exe, no matter if the Computer is connected to Internet or not.

Regards

Robert
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Long time to load form when running it

Post by davidc »

Thank you for the update Robert.

C3PO,

Is the packaged exe you used to test signed?
Can you check if you have SAPIEN or VeriSign listed as a Trusted Certification Authority?

Run certmgr.msc and check under:
Trusted Root Certification Authorities->Certificates

David
David
SAPIEN Technologies, Inc.
User avatar
C3PO_R2D2
Posts: 22
Last visit: Thu Jul 29, 2021 3:55 am

Re: Long time to load form when running it

Post by C3PO_R2D2 »

Hello Robert,

thanks a lot for your investigation and your update.


David,

I don't use signed packages.
Verisign is listed in the Trusted Certification Authority.


But I must say that I do have the differences of a packaged .exe script, and one ran from the Powershell Studio Environment. For some reason, the PSS environment does put a delay, that disappears when I disconnect my network card.

Is no one else experiencing this behaviour?
This topic is 10 years and 2 months 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.