Question: why bfs is slower than dfs?
Answer: Comparing BFS and DFS, the big advantage of DFS is that it has much lower memory requirements than BFS, because it's not necessary to store all of the child pointers at each level. ... Then, a BFS would usually be faster than a DFS. So, the advantages of either vary depending on the data and what you're looking for.