Simplify optimization for finding unique ID names
Changes PlannedPublic

Authored by Campbell Barton (campbellbarton) on Nov 6 2017, 6:12 AM.



This uses the last-hit instead of keeping track of the first available 64 values.

Testing the following command:

./blender -b --python-expr "for i in range((50000, locals().update(dict(bpy=__import__('bpy'))))[0]):'Name')"

Before: 93.77s
After: 39.36s

Since ID's are ordered, checking the next in the list works well and is less complicated.

Diff Detail

rB Blender
Build Status
Buildable 951
Build 951: arc lint + arc unit
Campbell Barton (campbellbarton) retitled this revision from Optimize finding unique names to Simplify optimization for finding unique ID names .Nov 6 2017, 6:44 AM
Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)

that change looks totally sane & fine by me…

This revision is now accepted and ready to land.Nov 8 2017, 11:14 AM

Tsk. there i a bug in this patch, I'll need to spend more time on it - although if it's too much hassle it mabe be better to abandon.

Campbell Barton (campbellbarton) planned changes to this revision.Nov 8 2017, 6:56 PM