Pseudo code and comments to explain:
// first select companies to process from db
foreach (company) {
// select the employees
foreach (employee of company) {
// select items they can access
foreach (item) {
// do some calculation and save
I believe this will be O(n^3) time complexity, please correct me if I am wrong - Big O has always given me a headache. My question is if you introduce Parallel processing at the first level, what does it become? What if we introduce a second parallel.foreach()
for the second iteration as well?
Edit:
It was suggested that What is O(...) and how do I calculate it? would address my question, however I am more interested in whether Parallel.Foreach
impacts time complexity so I believe the question is sufficiently different to stand on its own.