Optimise computation of orphan packages