This video demonstrates layer-2 convergence in less than 2 seconds thanks to rapid spanning-tree.
Rapid per-vlan spanning-tree is configured with "spanning-tree mode rapid-pvst".
The rapid spanning tree protocol, 802.1w, is the answer to the slow convergence time of the historic 802.1d spanning-tree protocol. Rapid spanning tree replaces timers with triggered updates. Switches almost never wait for a timer to expire. When converging on a new switch-to-switch link they will start with the port in the discarding state. The upstream switch (closest to the root bridge) will send a proposal to the downstream switch. The downstream switch will put all other downstream switch-to-switch (P2P) ports into the discarding state (preventing a loop) and then accept the proposal. Once the proposal is accepted, the switches will forward on the new link. Then the downstream switch will repeat the procedure on each downstream P2P link. While seemingly complex, because none of these actions wait for a timer to expire, the end result is spanning-tree reconvergence in seconds. Edge ports (going to end hosts) are known because they are configured with "spanning-tree portfast". Edge ports never go into the discarding state because they cannot create a bridging loop.
Rapid spanning-tree incorporates improved versions of the backbonefast and uplinkfast improvements, making configuration of those features unnecessary. It is still possible to configure bpduguard, rootguard, and loopguard. Configuring portfast is essential to identify edge ports.