Performance problems, possibly malware?
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