For a small beam size, the clean up is almost instant because there aren't many states. However, when the beam size is over 100,000. The clean up will become slow and also the memory usage is crazy. I tried beam size 2,000,000 with max 25 steps. 50Gb was used. My machine was out of memory so it had to store it on the SSD. This slows down the program massively.
It might be better to store the routes in every single state so that the parent state can be cleaned after children states are created. This will reduce memory usage significantly.
For a small beam size, the clean up is almost instant because there aren't many states. However, when the beam size is over 100,000. The clean up will become slow and also the memory usage is crazy. I tried beam size 2,000,000 with max 25 steps. 50Gb was used. My machine was out of memory so it had to store it on the SSD. This slows down the program massively.
It might be better to store the routes in every single state so that the parent state can be cleaned after children states are created. This will reduce memory usage significantly.