Performance problems, possibly malware? I have concerns about malware or something significantly affecting the performance of my iMac.

As you can see from the screen shot below I have updated to OS X Yosemite Version 10.10.5, but I did this after I started to have problems in the hope that any new security updates would help.



Additionally, I have installed Avast Mac Security and it hasn't identified anything.

Among my performance problems:


Applications can open very slowly.
Typing often has a very long lag before the letters or words appear on the screen.
Searches using Spotlight take ages.
Searches in Mail (which uses Spotlight?) take ages.
Clicking through folders in Finder can take ages for files to appear.


Very frustrating all of this.

I did have one of those MacKeeper things that locked up Safari one day but I've pretty thoroughly looked for evidence of it and can't find any.

Still, in the screenshot of my Activity Monitor below:



I consistently see the process, mds, seeming to command a ridiculous amount of CPU time.  This doesn't seem normal to me.

I have additionally, cleared Spotlight's index by adding Macintosh HD to the Privacy list them removing it.  I have further put just about every folder into the Privacy list except for Documents and Mail &amp; Messages.  In Spotlight's Search Results, I have unchecked everything except: 


Documents
Folders
Mail &amp; Messages
Contacts
Bookmarks &amp; History


and I still have all of this mds activity?

One more additional symptom, that has me concerned.  Some of my saved Safari information, like logins to innocent websites have disappeared.  Not certain if this followed the MacKeeper yuck or after the update to OS X Yosemite Version 10.10.5.

Also, I do have Time Machine running.  Not certain if the mds stuff has anything to do with it, but I even turned of Time Machine and I still saw all that mds activity.

Any suggestions about how to solve this problem or even how to analyze it much appreciated.
Well, for starters, clearing Spotlight's index will make mds have to work all the harder to refill it.

If you've ever had MacKeeper on there, you need to get hold of Malwarebytes to get rid of the leftovers.

Avast, in itself, will slow down your machine. I tried it once, got rid of it within a week.

I'd also be tempted to say updating to El Capitan might fix some of it. I found Yosemite was getting pretty laggy towards the end. I even posted on here about one aspect of it - Typing lag on SE sites - Safari