Performance of "deep cloning" operations in BricsCAD

I'm porting an ObjectARX plugin from AutoCAD to BricsCAD.

Perhaps naively, the plugin constructs an AcEdInputPointMonitor to keep track of the cursor position and interactively display/update complex geometry (think tens of polylines) on the screen.

To that end, the code frequently uses a deep cloning operation on previously calculated geometry (via AcDbDatabase::deepCloneObjects).

I tried running the ported plugin on a heavy file (~80 Mb), but it was extremely sluggish, which didn't happen with the original, AutoCAD, one. A quick profiling revealed that almost all of the processing time was spent on the aforementioned deep cloning operation, something that does not happen in AutoCAD (not only does the original AutoCAD plugin run smoothly on that heavy file, but also the deep cloning is not even the performance bottleneck).

Is this a known issue, and is there a workaround?

Comments