well barely losing gives you confidence and it lets you know what works what doesn't for next time. It's harder on you emotionally, but, for the future it's the best.
Losing badly, isn't as emotionally draining, you are out of the match the whole time and you just sorta go away. This sort of a loss however is bad for ones confidence overall, and it also is bad for the future because you didn't really test your opponent.
I think when the win isn't important, losing badly is the next best option to winning, I think if it's a big event barely losing is the worst....all in all though, I think most players will pick a win over either. Except maybe Roger who decides that sometimes he needs to take matches off to rest.