Understanding causes of windmill overhead #2119
Replies: 2 comments 6 replies
-
Thank you for the question and the investigation. I agree the overhead is significant. I think you almost have the full answer in your investigation, it must come from what is non-dummy. Would you be able to put timestamp/measure time of execution of the non-dummy logic. Maybe the result will surprise you. It seems to me that you have measured all the overhead that I can think of. |
Beta Was this translation helpful? Give feedback.
-
Hey @rubenfiszel - My PowerShell script which just prints the current date takes 8.167s to run in Windmill. Outside of Windmill inside an already running PowerShell process, it takes 1ms unsurprisingly. If I call it from bash: |
Beta Was this translation helpful? Give feedback.
-
I just migrated a typescript script to a flow in windmill. Windmill takes significantly longer to perform the same result:
Before: ~60s
In windmill: ~660s
Obivously, I get a lot of benefits from running it in windmill, but a factor of ~11 is significant. I would like to understand, where the overhead is coming from and how to possibly mitigate it.
What does this flow do?
It connects to a database, selects 1000 rows. Loops over the rows, for each row, it executes two deno scripts (which might make external API calls).
(But we can assume that the time spend waiting for external API calls isn't more than 60s in total. The script works also strictly sequential and won't do any API calls in parallel.)
To measure the overhead created by windmill, I created a dummy flow that just generates an array with 1000 entries, loops over them and executes two deno scripts that just print "Hello World". That dummy flow took 155s. So, 155s for all the magic windmill does (like passing input/output, validating input, storing all that, logging all output, etc.).
Adding the imports to the deno scripts, time of dummy flow increases to 190s. Makes sense, as the imports are executed 1000 times instead of once.
Where does the rest of the overhead come from (total overhead: 600s, explained overhead: 190s)? And how could it be reduced? I explicitely want to loop in windmill and not in deno to be able to see the individual runs of the "inner" scripts.
Beta Was this translation helpful? Give feedback.
All reactions