Page MenuHome

Cleanup: early out on invalid ID data to simplify control flow
ClosedPublic

Authored by Brecht Van Lommel (brecht) on Apr 3 2020, 5:13 PM.

Diff Detail

Repository
rB Blender

Event Timeline

Bastien Montagne (mont29) requested changes to this revision.Apr 4 2020, 4:45 PM
Bastien Montagne (mont29) added inline comments.
source/blender/blenloader/intern/readfile.c
9422

putting this before the linked data processing in case of undo is a step back in performances, since just getting the name of the ID is much cheaper than actually reading the whole struct.

Not saying this is a huge importance, we now file reading is not really performance critical currently in undo, but still, why?

This revision now requires changes to proceed.Apr 4 2020, 4:45 PM
source/blender/blenloader/intern/readfile.c
9422

The reason was to simplify the control flow. But after refactoring it's become relatively easy to avoid this memory allocation, also for the case where we are restorign local datablocks.

Done in D7336: Cleanup: avoid memory allocation for unchanged datablocks in undo. I'd rather not update this patch because it requires me to update the other 6 patches.

Brecht Van Lommel (brecht) marked an inline comment as done.Apr 4 2020, 5:46 PM
This revision is now accepted and ready to land.Apr 6 2020, 12:22 PM