best way to update screen

What is the best practice for tile based game, update all visible tiles on screen or update only tiles that need to be repainted?
If I update all the visible tiles my game will have more consistent frame rate, but if I update only tiles that need to be repainted game will have more performance because doesn’t need to update all tiles over and over.
If the second option is better, what is the best way to check if tiles need to be repainted?