How can I speed up multiple object joining (Python)?
I've been using this, which has featured on stack before.
def merge_objects(name, ob_list):
    ctx = context.copy()
    ob_list[0].name = name
    ctx[&quot;active_object&quot;] = ob_list[0]
    ctx[&quot;selected_editable_objects&quot;] = ob_list
    bpy.ops.object.join(ctx)
    return data.objects[name]

Naming is optional, but requires the tree as the first object in the list to keep its name.
def JoinTreeObjectsWithTree(tree, treeObjects):
    name = tree.name
    treeObjects.insert(0, tree)
    ctx = context.copy()
    ctx[&quot;active_object&quot;] = treeObjects[0]
    ctx[&quot;selected_editable_objects&quot;] = treeObjects
    bpy.ops.object.join(ctx)
    return data.objects[name]

finalOb = JoinTreeObjectsWithTree(tree, treeObjects)