Slow rebuilding on large puzzle 618

Started by brow42

brow42 Lv 1

I noticed that Lua RebuildSelected spends 20-25 seconds returning after accepting a pose. It spends a similar amount paused if you cancel, similar to canceling GUI Mutate Sidechains. This suggests a nasty nonlinearity in the algorithm, perhaps a lot of temporary tables? Actually picking the pose seems slower than usual, but not bad.

selection.SelectRange(147,149)
s=os.time()
structure.RebuildSelected(1)
print(os.time()-s)
selection.DeselectAll()

brow42 Lv 1

It may take 10-20 seconds to find a valid rebuild, one attempt per second, but then taking 20 seconds to return the result, after a pose has been found? It's spending more time just sitting there than it is rebuilding. I think there's room for improvement there.