Several species of shark and tuna have something special going on inside their bodies.

For a long time, scientists have known that some fish species appear warm-blooded.

Salmon sharks can elevate their body temperatures by up to 20 degrees compared to the surrounding water, for example.

But researchers did not understand why, as maintaining such a warm body requires a lot of food, and takes a lot of costly energy.

Now new research suggests that fish evolved this ability to enable them to swim faster.

And by doing so, they are able to migrate further each year than cold blooded fish of the same size.

For the first time, a team analysed the swim speeds of several species of shark and tuna. They discovered a significant advantage; these fish could swim an average of 2.5 times faster than their cold-blooded counterparts.

And that was just their cruising speed, not the maximum speeds they reach when say, hunting prey.

In order to analyse this speed, the team led by Yuuki Watanabe of the National Institute of Polar Research, Japan, tracked 15 fishes by adding sensors onto their dorsal fins.

This sensor has a timer which releases it after 2-4 days. It then floats to the surface of the ocean.

They essentially evolved similar adaptions independently

A team of researchers then compared these swim speeds to previously published data taking into account body temperature, body size and how the species relate to each other.

The study, published in PNAS journal, also reports that these warm body temperatures in shark and tuna are an example of convergent evolution.

Tuna are bony fish, and are only distantly related to sharks, which have skeletons made of cartilage.

The two split from a common ancestor more than 450 million years ago. We don't know much about this common ancestor but it was most likely also cold-blooded.

That means these sharks, and tuna, must have separately evolved the capacity to warm their blood, says ocean scientist Yannis Papastamatiou of the University of the St Andrews, UK.

"When you look at other shark species and more closely related groups, they also don’t have the ability to elevate body temperatures," he told BBC Earth.

"They essentially evolved similar adaptions independently as they are under the same sort of selective pressures," he said.

For example, as well as warming their blood, both tuna and certain large shark species have similar body shapes. They also can both swim fast and for long distances, benefits that outweight the costs of warming their bodies.

Follow Melissa Hogenboom and BBC Earth on twitter