Well, I did a quick test here.
First I created a file with 100 copies of a polysurface object in a line, plus a cut plane that intersects them all. I also random rotated the objects so that all the intersections will be different
I then ran the Rhino native command Split, splitting the 100 objects with the plane surface. That took around 19.5 seconds including mesh creation, which was over half the time.
I undid that and ran this script in rhinoscriptsyntax:
import rhinoscriptsyntax as rs
import Rhino, time
objs=rs.GetObjects("Select polysurface objects to split",16,preselect=True)
cutter=rs.GetObject("Select cutting surface",8)
st=time.time()
rs.EnableRedraw(False)
for obj in objs: rs.SplitBrep(obj,cutter)
rs.EnableRedraw()
print "Elapsed time = {:.2f}".format(time.time()-st)
The result was 16.38 seconds including meshing, so a little speed gain on the Native Rhino command, but not much. The actual split time was around 6.5 seconds, the rest meshing.
I then ran a similar test in RhinoCommon:
import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino, time
objs=rs.GetObjects("Select polysurface objects to split",16,preselect=True)
cutter=rs.GetObject("Select cutting surface",8)
st=time.time()
tol=sc.doc.ModelAbsoluteTolerance
breps=[rs.coercebrep(obj) for obj in objs]
cut_plane=rs.coercebrep(cutter)
splits=[]
to_delete=[]
for i,brep in enumerate(breps):
result=brep.Split(cut_plane,tol)
if result:
splits.extend(result)
to_delete.append(objs[i])
if splits:
for s_brep in splits: sc.doc.Objects.AddBrep(s_brep)
if to_delete:
for objID in to_delete: sc.doc.Objects.Delete(objID,True)
sc.doc.Views.Redraw()
Rhino.RhinoApp.Wait()
print "Elapsed time = {:.2f}".format(time.time()-st)
The result was virtually identical to the rhinoscriptsyntax version, to within a few hundredths of a second. That is pretty much expected, as rhinoscriptsyntax is calling RhinoCommon code behind the scenes and it still has to so the same thing - get the object IDs, get the geometry associated with the ID, split the objects, write the split parts to the document and delete the originals…
So, not much to be gained in this particular situation by running in “pure” RhinoCommon over rhinoscriptsyntax.
(the Rhino file is a bit to big to post here)