Performance, studio vs background

Hi,

I have a process that reads approx 27 csv files over the network using a StreamReader and inserts the values into database tables after reading them.

While devolping this in studio and using the Run File, the process takes roughly 2.5-3 minutes.
When running from Orchestrator (or via Assistant) the process runs out of memory after 10-15 minutes. To test further I removed the transactional files which had 300k or so records and left only the metadata files. This meant the process ran sucessfuly however it took nearly 13 minutes from assistant vs 42 seconds in studio. The files are stored in a network folder, however I copied them over to my D drive and the process still takes nearly 13 minutes.

You can see from the table below, that while (except for the 3rd file) the assistant process times are slower, it doesn’t explain 42 seconds vs 13 minutes. The stopwatch for the timer starts when the invoked workflow starts, and ends after the database write is complete. Only work done after the timer is updating the string which holds the HTML text for the e-mail output.

Assistant Studio
0 (0 ms) 0 (0 ms)
0 (3.5 s) 0 (3.1 s)
0 (3.2 s) 0 (3.5 s)
1099 (18.1 s) 1099 (4 s)
931 (15.3 s) 931 (1.5 s)
4965 (60.6 s) 4965 (2.6 s)
22 (678 ms) 22 (148 ms)
4 (245 ms) 4 (160 ms)
5 (233 ms) 5 (121 ms)
50 (737 ms) 50 (166 ms)
107 (2.5 s) 107 (348 ms)
26 (702 ms) 26 (116 ms)
7 (237 ms) 7 (122 ms)
3 (255 ms) 3 (139 ms)
12 (295 ms) 12 (108 ms)
22 (511 ms) 22 (156 ms)
677 (3.1 s) 677 (2.2 s)
7788 (94.1 s) 7788 (3.2 s)
1067 (16.5 s) 1067 (957 ms)
58 (71 ms) 58 (67 ms)
120 (1.5 s) 120 (116 ms)
6 (296 ms) 6 (107 ms)
9 (284 ms) 9 (276 ms)
7 (467 ms) 7 (137 ms)
52 (1.2 s) 52 (122 ms)
27 (422 ms) 27 (114 ms)