Page MenuHome

Performance: Flush selection to edges/faces.
ClosedPublic

Authored by Jeroen Bakker (jbakker) on Jun 18 2021, 9:33 AM.
Subscribers
None
Tokens
"Love" token, awarded by gilberto_rodrigues."Love" token, awarded by franMarz."Pterodactyl" token, awarded by shader.

Details

Summary

This patch uses threading to flush selection from verts to edges and
from edges to faces. The solution is lockless and should scale well on
modern CPU architectures.

Master:


Patch:

End user performance went from 3.9 to 4.6 FPS (Stanford Dragon) but that
was measured on a Intel Core i7-6700 CPU and AMD RX480 Gpu. The more
cores the better improvements you get.

Diff Detail

Repository
rB Blender
Branch
arcpatch-D11644 (branched from master)
Build Status
Buildable 15325
Build 15325: arc lint + arc unit

Event Timeline

Jeroen Bakker (jbakker) requested review of this revision.Jun 18 2021, 9:33 AM
Jeroen Bakker (jbakker) created this revision.

Resynced with master. Update counting on the fly.

Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Jun 21 2021, 9:06 AM
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Jun 21 2021, 9:13 AM

Overall looks good. Just a few opinions on the style:

source/blender/bmesh/intern/bmesh_marking.c
337

I don't know if it's already been decided but, it was argued that the conversion for callbacks is to have the _fn suffix.
Different suffixes are currently being used (_cb, _func...) it would be nice to have a convention on this.

388

Maybe bm_mesh_select_mode_flush_reduce_fn to have a suffix indicating that it will be used as a callback only.

397

Seeing other uses of BM_iter_parallel, instead of a value for min_iter_per_thread, we could use:
settings.use_threading = elem_len >= BM_OMP_LIMIT;
(just an idea)

This revision is now accepted and ready to land.Jun 21 2021, 2:11 PM
Jeroen Bakker (jbakker) marked 3 inline comments as done.

Addressed review comments. (code style)