I've sailed with dolphins plenty of times. They've tended to lose interest when I was on a windsurfer or dinghy after a minute or so, no matter what speed I was doing. On the other hand, when I've been on a cruising cat, they can't seem to get enough. As long as you stay over 7 knots under sail they'll follow along apparently having great fun, particularly around and between the bows. I've even seen a large pod travelling in one direction hook a U-turn when they saw the boat to play for ten minutes before heading back in their original direction.
All of this is to say what everyone else is saying. They're complex creatures with sometimes non-trivial motivations.