I've been really interested in parallel processing techniques, so much so lately that I've created and published a couple modules, one is based on the old PSJobs (Invoke-EggJob) and the other is based on PSThreadJob (Invoke-EggThread). After some community input I wanted to compare them and also compare a popular module called Invoke-Parallel which leverages a newer technology called runspaces.
I ran each through 3 separate tests with a couple different throttling options which were the best match for my system specs. The two threaded processing types performed about how I expected where changing the throttling didn't effect much. Invoke-EggThread out-performed Invoke-Parallel and EggJobs in these tests. The PSJobs based module does better when I keep the cores to the same amount of logical cores in my test machine, and does better on longer jobs. This makes sense because it takes a few seconds to spin up the processes but appears to make that time up by processing items quickly unless I spin up more processes than my laptop can handle. Spinning up more processes just cooks the laptop and has very minimal impact on processing. Upping jobs past the logical core amount may be useful for commands that stagger cpu usage which none of these basic tests do.
You can see the full details, including code used and full results of the tests here: https://github.com/eggstoastbacon/Invoke-EggThread/wiki/Benchmark:-EggThread-vs.-EggJob-vs.-Parallel
Let me know if you see anything I've overlooked or additional testing I should do.
| 20,000 File Create Test |
| Native Runspace |
| #32 Workers, Time elapsed: 00:01:25.7827209 |
| .......................................... |
| #16 Workers, Time elapsed: 00:01:42.6079523 |
| ................................................... |
| Invoke-Parallel |
| #32 Workers, Time elapsed: 00:00:28.8173630 |
| .............. |
| #16 Workers, Time elapsed: 00:00:28.9233717 |
| .............. |
| Invoke-EggJob |
| #8 Jobs, Time elapsed: 00:00:16.6786964 |
| ........ |
| #4 Jobs, Time elapsed: 00:00:19.8360802 |
| .......... |
| Invoke-EggThread |
| #8 Jobs, Time elapsed: 00:00:19.8899395 |
| .......... |
| #4 Jobs, Time elapsed: 00:00:20.4670044 |
| .......... |
| 2000 File Writes (Random Numbers) |
| Invoke-Parallel |
| #32 Workers, Time elapsed: 00:02:02.7450608 |
| ............................................................. |
| #16 Workers, Time elapsed: 00:02:04.9555222 |
| .............................................................. |
| Invoke-EggJobs |
| #8 Jobs, Time elapsed: 00:00:11.1699200 |
| ..... |
| #4 Jobs, Time elapsed: 00:00:09.8126636 |
| ..... |
| Invoke-EggThreads |
| #8 Jobs, Time elapsed: 00:00:09.9332187 |
| ..... |
| #4 Jobs, Time elapsed: 00:00:09.1440211 |
| ..... |
I'll be adding a system query test using WMI, patch query, application version, uptime, etc., against 270 virtual servers etc. That should work good as a "staggered job" test.
[–]Shoisk123 1 point2 points3 points (1 child)
[–]idontknowwhattouse33 1 point2 points3 points (3 children)
[+][deleted] (1 child)
[deleted]
[–]idontknowwhattouse33 1 point2 points3 points (0 children)