Coffee expert James Hoffman has scientifically demonstrated why espresso should be stirred, not swirled. If you're wondering why either of these things would be done to a cup of espresso in the first place, the video gives a great explanation: the dark, thick liquid at the bottom of your espresso cup will be the most concentrated, since it's the first to come out of the espresso machine. The liquid in the middle will be less strong, and the top layer of your espresso will be the least flavorful and the lightest.
Many people give their espresso cup a few swirls before drinking it, as an attempt to mix these layers of espresso. Hoffman says it's better to mix the espresso with a little spoon before drinking it. He uses a device to test the difference in strength between the top layer of a mixed espresso vs a stirred espresso. The conclusion is that stirring the espresso will mix the layers more efficiently than swirling it, creating a drink that tastes equally good from top to bottom.