Undo aka ctrl + z is a pain on my system with Blender
Consider Blender undo/redo as an automately backup system, they read all data in previous step and load all of them directly. (2.8x)

 (2.9x add some optimized method to it, see the link below) 

 (2.7x and below is another system) 

memory management - Poor Undo Performance: Blender 2.9 - Blender Stack Exchange
⚓ T60695 Optimized per-datablock global undo

Handling time will depend on your memory accessing speed and your data 'size'. In some situation, undo/redo can be bulky:

Large amount of meshes vertices
Low available system memory (RAM) causing constantly memory swap
Dirty blender file with lots of abandon/orphan data chunks leaved in data
Cumulative memory leak in process when running Blender (restart Blender)