What is com.apple.medialibraryservice.xpc? Occasionally when I am using iPhoto an app with a generic white Lego piece icon opens on the dock with the name "com.apple.MediaLibraryService.xpc". 

Activity Monitor lists it as "(Not Responding)" and shows it using a pretty large amount of CPU time. When I quit iPhoto its % CPU drops to zero, but it remains in the dock and remains unresponsive in Activity Monitor.

It doesn't happen every time I use iPhoto, and there doesn't seem to be any particular action that triggers it to open. It does seem to correspond to a general slowing of responsiveness (already not great) in iPhoto. I am generally loathe to force quit something if I don't know what it is.

Does anyone know what this app does, why it is opening, and how to prevent it from hogging my CPU when I'm working?
The com.apple.medialibraryservice.xpc is a process used for a number of Apple-specific applications and services, including: indexing photos through iTunes (when syncing), and importing and exporting images in iPhoto. 

Some users have reported that this happens when importing slo-mo videos into iPhoto from the iPhone 5s. This could be happening to you when syncing your iOS device--you can disable automatic syncing for iTunes as a temporary fix to see if helps your situation.