Improve performance of calculating device lists changes in `/sync`.