a week ago
Hi Team,
we have started using python in Blueprism 7.5 and python code stages is taking lot of time to execute and come out of code stages.
do we have to do anything to make this fast or this is normal that python always take long time to execute ? or do we have to review anything in our sytems ?
what will be the reason ?
a week ago
My thoughts here are purely based on my experience with this as well and not any understanding of how it works underneath.
It's normal as far as I've experienced. I've been testing Blue Prism 7.5.1 to run Python code stages, and it takes about 2 seconds to start and end for me. I ended up choosing to not use the feature because in my scenario I wanted to repeatedly call the code stages for tiny interactions with the screen, and that led to very long run times. I switched back to using C# since there's no delay in that.
As I understand it, there is some Python bridge activity that has to happen from .NET to Python, and this is what is taking so long since it has to do this each time the code stage is called.
A workaround if you really want/need to use Python is to make your Python calls be in much larger scripts where it does a bunch of stuff in each instance of calling a code stage. Then the few seconds of extra time is not a big deal. Hopefully this gets improved in the future as I would like to be able to use Python code stages for quick operations.
a week ago
Thanks Dave, looks like i have to switch back to c# or vb.net , python is awesome but performance is not good ,
Monday
real reason for using python is , i have an automation where i have to upload files into SFTP server and long back ago i have build VB.Net and C# code , that is working fine if we pass password , however this time i have to pass password in .pem file and code is not working , i am not sure is this because of Renci DLL version or something else
then i have written python and its working perfectly fine.
Monday
Then I'd suggest doing one of two things:
Either (1) Stage all the files to be uploaded in advance in some folder(s), and then have a Python code stage that loops over them all and uploads them rather than calling the stage repeatedly for each one.
Or (2) Reference a post like Execute python script - SS&C Blue Prism Community and call Python as a process outside of Blue Prism which would probably work faster and enable you to call it repeatedly and more quickly, but I have never done this specifically from Blue Prism before so I can't be sure how fast it is.
@ewilson may be able to direct you more on this. I think he has created tutorials on this before (at least iron python), but I can't seem to find that now.
Monday
@naveed_raza What version of SSH.NET were you using?
With Python, as @david.l.morris mentioned, there is a translation layer because of the interpreted nature of Python. When you say it's taking a long time to execute, how long are we talking?
Are you actually writing Python inside your BP code stages, or are you invoking Python scripts using something like Utility - Environment::Start Process action?
Cheers,
Eric
Monday
Hi @ewilson , generally it was 2-4 seconds even for simple things like math or string concatenation.
Here's an example: https://youtu.be/qmrwQph0_kk?si=h-yEPQDlxsi_agaI&t=601
That should take you to a point in the video where I tested the code stage right after. You'll see that it takes around 3 seconds after I pressed F10 to step over the code stage. I tested in various other scenarios as well on a work computer and my home computer, with and without a venv. But in all scenarios it was pretty slow to start and end the code stage. Once it got started, it was plenty fast and then took a second or two to go to the next stage.
Tuesday
i have written python code inside BP Code stage , when we execute its taking around 4mins of time.
for an example , one of the code will convert saved excel file into CSV and its taking 3mins of time
Tuesday
@naveed_raza if you want to stick with Python, the first thing I would do is move that Python code to a regular .py script and try executing it outside of Blue Prism to see how long it takes. After that, I would test the same .py script file from within Blue Prism by calling it from the Utility - Environment VBO and see if there's a significant change in the timing. If there isn't you'd probably need to open a ticket with support to troubleshoot the latency with Python code stages.
Otherwise, I'd switch back to C# or VB.Net for that feature.
Cheers,
Eric
Thursday
okay, i will try this and i need small information , SSH.Net blueprism object is there on Digital Exchange , that will work if we pass .pem file as an input to connect to server ?