Achieving vertical scaling by executing compute functions in parallel

Next, we will shift our focus to the mechanism that's used to execute compute functions. A rather simplistic approach would be to use a for loop construct to iterate the vertices in the graph and invoke the compute function for each vertex in a sequential fashion. While the approach would undoubtedly work as expected, it would be a rather inefficient use of the compute resources that are at our disposal. Running compute functions sequentially would only make use of a single CPU core; that would be quite a waste given that machines with up to 64 cores are readily available from the majority of cloud providers.

A much better alternative would be to fan out the execution of ...

Get Hands-On Software Engineering with Golang now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.