## Updating smooth normals
`BKE_pbvh_update_normals` takes up 50% of of time in some cases. The use of atomics in `pbvh_update_normals_accum_task_cb` to add normals from faces to vertices is problematic. Ideally those should be avoided entirely but it's not simple to do so. Possibilities:
* Figure out which vertices are shared with other nodes, and only use atomics for those.
* Store adjacency info for the entire mesh, and gather normals per vertex.
* Store adjacent faces of all border vertices of a node, and avoid a global vertex normal array and atomics.
* ...?
Smoothing tools may also be able to benefit from this, to work with the overhead of storing adjacency info of the entire mesh.
## Incoherent memory access
Each PBVH node contains a subset of the mesh vertices and faces. These are not contiguous so iterating over all vertices in node leads to incoherent memory access.
Two things we can do here:
* Ensure vertex and face indices in a node are at least sorted.
* Reorder vertex and face indices in the original mesh, so that all vertices and faces unique to a node are all stored next to each other in the global mesh array. Also would could reduce PBVH memory usage.
## Clipping and partial redraw
* {T70295}
## Draw Buffers
* {D5926}
* {D5922}
* Submitting vertex buffers to the GPU has some overhead. It may be possible to do those copies asynchronously in the driver.
## Masks
Tagging PBVH nodes as fully masked would let us skip iterating over their vertices for sculpt tools. Drawing code could also avoid storing a buffer in this case, though the overhead of allocating/freeing that often may not be worth it.
Tagging PBVH nodes as fully unmasked would let us quickly skip drawing them as part of the overlay.