I'm also kind of skeptical about such kind of speed enhancements. This really should be done on object level, which is a part of depsgraph recode (which i hope will happen :) and once threading is done on object leve;, there should be no threading on DM level.
Unless it doesn't take time on figuring out where arrays could be filled in simultaneously would just leave things as is: we'll need to re-benchmark code once depsgraph is multithreaded anyway :) On Sat, Jan 19, 2013 at 8:21 AM, Campbell Barton <ideasma...@gmail.com>wrote: > Revision: 53903 > > http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53903 > Author: campbellbarton > Date: 2013-01-19 02:21:53 +0000 (Sat, 19 Jan 2013) > Log Message: > ----------- > use openmp for building bmesh arrays, also replace calloc with malloc. > > Modified Paths: > -------------- > trunk/blender/source/blender/bmesh/intern/bmesh_mesh_conv.c > > Modified: trunk/blender/source/blender/bmesh/intern/bmesh_mesh_conv.c > =================================================================== > --- trunk/blender/source/blender/bmesh/intern/bmesh_mesh_conv.c 2013-01-19 > 02:01:18 UTC (rev 53902) > +++ trunk/blender/source/blender/bmesh/intern/bmesh_mesh_conv.c 2013-01-19 > 02:21:53 UTC (rev 53903) > @@ -416,22 +416,20 @@ > > if (me->mselect && me->totselect != 0) { > > - BMVert **vert_array = MEM_callocN(sizeof(BMVert *) * > bm->totvert, > - "Selection Conversion > Vertex Pointer Array"); > - BMEdge **edge_array = MEM_callocN(sizeof(BMEdge *) * > bm->totedge, > - "Selection Conversion > Edge Pointer Array"); > - BMFace **face_array = MEM_callocN(sizeof(BMFace *) * > bm->totface, > - "Selection Conversion > Face Pointer Array"); > - > - BMIter iter; > - BMVert *vert; > - BMEdge *edge; > - BMFace *face; > + BMVert **vert_array = MEM_mallocN(sizeof(BMVert *) * > bm->totvert, "VSelConv"); > + BMEdge **edge_array = MEM_mallocN(sizeof(BMEdge *) * > bm->totedge, "ESelConv"); > + BMFace **face_array = MEM_mallocN(sizeof(BMFace *) * > bm->totface, "FSelConv"); > MSelect *msel; > > - BM_ITER_MESH_INDEX (vert, &iter, bm, BM_VERTS_OF_MESH, i) > { vert_array[i] = vert; } > - BM_ITER_MESH_INDEX (edge, &iter, bm, BM_EDGES_OF_MESH, i) > { edge_array[i] = edge; } > - BM_ITER_MESH_INDEX (face, &iter, bm, BM_FACES_OF_MESH, i) > { face_array[i] = face; } > +#pragma omp parallel sections if (bm->totvert + bm->totedge + bm->totface > >= BM_OMP_LIMIT) > + { > +#pragma omp section > + { BM_iter_as_array(bm, BM_VERTS_OF_MESH, NULL, > (void **)vert_array, bm->totvert); } > +#pragma omp section > + { BM_iter_as_array(bm, BM_EDGES_OF_MESH, NULL, > (void **)edge_array, bm->totedge); } > +#pragma omp section > + { BM_iter_as_array(bm, BM_FACES_OF_MESH, NULL, > (void **)face_array, bm->totface); } > + } > > for (i = 0, msel = me->mselect; i < me->totselect; i++, > msel++) { > switch (msel->type) { > > _______________________________________________ > Bf-blender-cvs mailing list > bf-blender-...@blender.org > http://lists.blender.org/mailman/listinfo/bf-blender-cvs > -- With best regards, Sergey Sharybin _______________________________________________ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers