BKE's DerivedMesh: get rid of last OMP usage.
authorBastien Montagne <montagne29@wanadoo.fr>
Sun, 29 May 2016 18:14:42 +0000 (20:14 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Sun, 29 May 2016 18:14:42 +0000 (20:14 +0200)
Not replacing with some BLI_task_stuff here, tests show this is pointless
(in absolute best case - i.e. single huge mesh in scene - parallelizing here switches
from 0.8ms to 0.5ms for that piece of code - with something like 750ms per frame update...).

source/blender/blenkernel/intern/DerivedMesh.c

index a3e7e5f1ac44b6b2edd66f08bacdb172c1a7fef9..bb5cc9cb0678fe973d96e8a65f2b35d6e5744e4c 100644 (file)
@@ -2003,15 +2003,10 @@ static void mesh_calc_modifiers(
                                        DM_add_edge_layer(dm, CD_ORIGINDEX, CD_CALLOC, NULL);
                                        DM_add_poly_layer(dm, CD_ORIGINDEX, CD_CALLOC, NULL);
 
-#pragma omp parallel sections if (dm->numVertData + dm->numEdgeData + dm->numPolyData >= BKE_MESH_OMP_LIMIT)
-                                       {
-#pragma omp section
-                                               { range_vn_i(DM_get_vert_data_layer(dm, CD_ORIGINDEX), dm->numVertData, 0); }
-#pragma omp section
-                                               { range_vn_i(DM_get_edge_data_layer(dm, CD_ORIGINDEX), dm->numEdgeData, 0); }
-#pragma omp section
-                                               { range_vn_i(DM_get_poly_data_layer(dm, CD_ORIGINDEX), dm->numPolyData, 0); }
-                                       }
+                                       /* Not worth parallelizing this, gives less than 0.1% overall speedup in best of best cases... */
+                                       range_vn_i(DM_get_vert_data_layer(dm, CD_ORIGINDEX), dm->numVertData, 0);
+                                       range_vn_i(DM_get_edge_data_layer(dm, CD_ORIGINDEX), dm->numEdgeData, 0);
+                                       range_vn_i(DM_get_poly_data_layer(dm, CD_ORIGINDEX), dm->numPolyData, 0);
                                }
                        }