CoreWF icon indicating copy to clipboard operation
CoreWF copied to clipboard

Performance issue with large XAML files

Open volodymyr-basiuk opened this issue 3 years ago • 2 comments

I have a few workflow XAML files which has near 90 000 lines in it. Actually it is executing successfully, but it takes near 40 minutes to execute. The same workflow executing near 30 second on .Net framework WF on the same machine.

Do you have any suggestions how to speed up this process ?

One more think I found while migrating that ref xmlns:sad="clr-namespace:System.Activities.Debugger;assembly=System.Activities" did not work in CoreWF: System.Activities.Debugger is inside UiPath.Workflow assembly. You have same ref in NonGenericForEach.xaml, but it is not used.

volodymyr-basiuk avatar May 19 '22 08:05 volodymyr-basiuk

@dmetzgar We are trying to port our .NET 4.7 application to .NET 6, and also met 10x slower performance when executing a simple xaml (but with out own dll reference), from 500ms to 5s. Profiling shows it's the same callstack as in this PR: https://github.com/UiPath/CoreWF/pull/178.

Although it's becoming very fast on the second run, we could have many xaml files loaded in a single operation, so it will become a big overhead.

In .NET framework, compiling VB script is using VbHostedCompiler, but now it's JIT compiler, and BuildAssembly() takes too much time. Want to confirm is this really a no-solution issue as you mentioned in the PR?

A significant portion of the performance issue comes from the Script implementation itself. An odd thing about the Script implementation for VB is that it was dropped from Roslyn: https://github.com/dotnet/roslyn/issues/13523#issuecomment-462433207

cc @lbargaoanu

angelowang avatar Apr 17 '23 11:04 angelowang

We also observed a high memory usage issue when running a large xaml file. After debugging we noticed there are dead Native Memory objects that are not collected which can get up to more than 1GB, this sometimes lead to Insufficient Memory issue if the xaml file is too large.

chenleo-msft avatar Sep 13 '23 23:09 chenleo-msft