* Place objects in layer all at once rather than one at a time.
This reduces (by a factor of the number of objects in the layer) the number of times that the layer contents are traversed to set the properties of the contained objects.
This means the layer insertion of O(n) rather then O(n^2) on the number of objects.
Also remove a loop invariant in view_layer so the chidren are not traversed if colours or appearnces are not inherited from the layer.
Fixes#15732
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>