There are some apps to search inside a Photos library for duplicates. Is that what you want to do? If so you want an app that will identify the potential duplicates, put them in an album or mark them with a keyword for easy retrieval and deletion by you. You don't want one that does the deletion itself for obvious reasons.
I've run tests on the following apps with these results:
PhotoSweeper - $9.99 - Demo version available.
PowerPhotos - $29.95
PowerPhotos is the iPhoto Library Manager version for Photos and is very powerful. Although more expensive I would recommend it as it has more capabilities than the others like the capability to merge Photos libraries or copy photos, both original and edited versions, along with their metadata between libraries.
PhotoSweeper compares bitmaps and/or histograms so it can detect duplicate images even if they have different file sizes, file names, image sizes and capture dates.
That being said there is no reason to ever run any "cleaning", "optimizing", "speed-up" or anti-virus apps on your Mac.
For those concerned about security this user tip describes what you need to know and do to protect your Mac: Effective defenses against malware and other threats - Apple Community