Parallel vs Threading
-
I'm doing some automated testing where I read a datarow from a spreadsheet then pull in a set of steps from and apply the data to a web page. There is no dependency between the data row, each using its own browser instance to simulate an individual user. From the little I've learned there are performance differences between parallel and thread based executions. At the moment I intend to go thread based - but may I have some feedback from community based in your experience.
Ger
-
I'm doing some automated testing where I read a datarow from a spreadsheet then pull in a set of steps from and apply the data to a web page. There is no dependency between the data row, each using its own browser instance to simulate an individual user. From the little I've learned there are performance differences between parallel and thread based executions. At the moment I intend to go thread based - but may I have some feedback from community based in your experience.
Ger
There is no easy answer. Depending on the type processing required and the hardware resources available (i.e. CPU "cores"), parallelizing will perform better or it may not. Building and tearing down tasks incurs overhead; overhead not incurred in "non-parallel" operations. If the load can be spread around, and all tasks can run independently then parallelizing can work for you; otherwise it may not. You need to benchmark your options and keep in mind your final configuration; don't optimize prematurely.
-
There is no easy answer. Depending on the type processing required and the hardware resources available (i.e. CPU "cores"), parallelizing will perform better or it may not. Building and tearing down tasks incurs overhead; overhead not incurred in "non-parallel" operations. If the load can be spread around, and all tasks can run independently then parallelizing can work for you; otherwise it may not. You need to benchmark your options and keep in mind your final configuration; don't optimize prematurely.
112 pages take 50 mins to complete sequentially
Ger
-
112 pages take 50 mins to complete sequentially
Ger
-
And? I once got a payroll job that ran for 24 hours down to 20 minutes by presorting one of the input files. No multitasking.
And ... I expect some experimentation is in order. I've never operated beyond a single thread in a commercial environment before - I've never had the need, just like your experience a decent sort or index has always been sufficient. If it works well, it should give me a simulated multi user situation. Each discrete task opens a web page, browses to a URL (served by localhost) fills two text boxes hits two radios, clicks a button then kills the page.
Ger
-
And ... I expect some experimentation is in order. I've never operated beyond a single thread in a commercial environment before - I've never had the need, just like your experience a decent sort or index has always been sufficient. If it works well, it should give me a simulated multi user situation. Each discrete task opens a web page, browses to a URL (served by localhost) fills two text boxes hits two radios, clicks a button then kills the page.
Ger
I see; thank you. The problem (IMO) you are faced with is that the response from each web page (i.e. site) can be different; based on the path to that site. I would therefore say your app is "IO / Input bound". In this case, parallel processing should help since other tasks can run while others wait for a web response (using asynchronous callbacks). (Out of curiosity, I would put "stop watch" code around my internet accesses and time them for the various sites).
-
I see; thank you. The problem (IMO) you are faced with is that the response from each web page (i.e. site) can be different; based on the path to that site. I would therefore say your app is "IO / Input bound". In this case, parallel processing should help since other tasks can run while others wait for a web response (using asynchronous callbacks). (Out of curiosity, I would put "stop watch" code around my internet accesses and time them for the various sites).
For the specific test threading reduced the elapsed time from 50 to 25 mins, and significantly improved CPU utilisation.
Ger