From 1b4d5c7a35597a70411515f721a405416244b540 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 13 Jul 2021 17:28:07 +1000 Subject: Undo System: avoid redundant decoding on undo In most cases the undo system was loading undo steps twice. This was needed since some undo systems (sculpt, paint, text) require stepping out of the current undo step. Use a flag to limit this to the undo systems that need it. This improves performance for other undo systems. This gives around 1.96x speedup in edit-mesh for high-poly objects. Reviewed by: mont29 Ref D11893 --- source/blender/editors/space_text/text_undo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/space_text') diff --git a/source/blender/editors/space_text/text_undo.c b/source/blender/editors/space_text/text_undo.c index f55db8c3cc9..80af7d8c9f6 100644 --- a/source/blender/editors/space_text/text_undo.c +++ b/source/blender/editors/space_text/text_undo.c @@ -265,7 +265,7 @@ void ED_text_undosys_type(UndoType *ut) ut->step_foreach_ID_ref = text_undosys_foreach_ID_ref; - ut->flags = UNDOTYPE_FLAG_NEED_CONTEXT_FOR_ENCODE; + ut->flags = UNDOTYPE_FLAG_NEED_CONTEXT_FOR_ENCODE | UNDOTYPE_FLAG_DECODE_ACTIVE_STEP; ut->step_size = sizeof(TextUndoStep); } -- cgit v1.2.3