Why to gif though, when you have services like https://mediacru.sh that are awesome because they replace gif by video?
That being said, I’m almost certain that video formats performs better than gif (e.g. WebM), but the gif format is still the easiest to work with at the moment:
<img src="http://gif.gg/xyz.gif">