I am reading the book "Computational Homology" by Tomasz Kaczynski, Konstantin Mischaikow and Marian Mrozek and in several places it says something to the effect of "of course, from the viewpoint of computations there are more efficient algorithms for counting connected com- ponents than directly computing $H_0$" (see p. 277) and similarly when discussing Figure 1.5 on p.9.
What are the algorithms they are referring to? Is it the DFS and BFS as discussed here? What is it exactly that makes computing $H_0$ to detect connected components a bad idea? Is it the fact that in addition to solving a combinatorial problem (connecting pixels), you go to algebra and compute homology?