The undo system is described in more detail here: T95450. See T95401 for a description of how the update cache works, which the undo system is based on.
The undo system can be enabled and disabled in the Experimental section (Only visible if Interface>Developer Extras is enabled) under Debugging in the user preferences.
Note that the update-cache has to be enabled for the undo system to work.
Disclaimer: Right now, operations that don't use the update cache will make a full-copy which can lead to large memory usage!
Demo
Intel® Core™ i7-9700 CPU @ 3.00GHz with 8 cores:
Performance
Test file: heavy_test_file.blend (from T91945)
Single GP object with:
- 86 layers
- 11k frames
- 300k stokes
- 13M points
OS: Windows 10
CPU: Intel(R) Xeon(R) E5-1650 v4 @ 3.60GHz
Best case scenario (drawing strokes, sculpting, vertex paint)
Encoding an undo step:
| Step (avg of 10) | master (2022-02-04) | patch |
| Encoding | 0.3192669 s | 0.0000279 s |
Decoding an undo step:
| Step (avg of 10) | master (2022-02-04) | patch |
| Decoding | 2.1854196 s | 0.0000295 s |
| Depsgraph update after decode | 1.0886491 s | 0.0015363 s |
| Total | 3.2740687 s | 0.0015658 s |
Worst case scenario (deleting a layer, reordering layers)
Encoding an undo step:
| Step (avg of 10) | master (2022-02-04) | patch |
| Encoding | 0.3250911 s | 0.7913403 s |
Decoding an undo step:
| Step (avg of 10) | master (2022-02-04) | patch |
| Decoding | 2.161628 s | 0.8676814 s |
| Depsgraph update after decode | 1.1315799 s | 1.0737802 s |
| Total | 3.2932079 s | 1.9414616 s |
Measurements done using --debug-depsgraph-time.
TODOs:
- Calculate memory size of encoded steps
Co-authored-by: @Yann Lanthony (yann-lty)