My code has a large set of available 'cells' (user defined type). At each
iteration we add some cells to the available cells set, iterate over it,
find the 'best' cell, and delete it from the available cells set (every
cell is added and deleted from available set exactly once, I am not worried
about deletion from a perfomance perspective).
Profiling the program, I see that it spends about half its time in the line
where we iterate over the available cells :
4101 ...lia/rgb_notebook.jl; run; line: 144
5 ...lia/rgb_notebook.jl; find_best_point; line: 82
2 no file; Voxel; line: 0
1714 ...lia/rgb_notebook.jl; find_best_point; line: 86
<- THIS LINE
223 dict.jl; skip_deleted; line: 670
535 dict.jl; skip_deleted; line: 671
309 dict.jl; skip_deleted; line: 672
326 dict.jl; skip_deleted; line: 674
2247 ...lia/rgb_notebook.jl; find_best_point; line: 87
86 for cell in available_pts
It seems like the way that dict deletes from set / iterates over it, is
causing performance issues, does anyone have any ideas how to improve this?