macOS Sierra: What is photoanalysisid

After my iMac updated to macOS Sierra I started to run into out of memory errors. On checking Activity Monitor I spotted a process called photoanalysisid, which was taking 130% CPU time.

Loading photos I saw that it was scanning photos for faces as it does on iOS 10. I have an album of 22,000 photos and 6 hours later the analysis was done.

So if you are running into a slow mac or out of memory errors on updating here's your culprit.