Exponential lag with ctrl + z in pixel editor

There is a exponential lag with ctrl + z or using shortcut undo.
the more you undo the more it lags. exactly - when i undo one time it lag but when i undo twice consequitively it lag for more time, when i do thrice it does for even more time . and add more it freezes.