walkinside / sdk

Develop powerful desktop and web applications on top of Walkinside 3D engine
4 stars 4 forks source link

VRUserGroup.Add very slow when adding branch with many elements #48

Open kkneip opened 6 years ago

kkneip commented 6 years ago

Hi,

when I add a branch with many contained elements (~65k) to a VRUserGroup it takes a long time (>11sec) to process.

var root = Viewer.ProjectManager.CurrentProject.BranchManager.GetRoots(VRBranchKind.Cad).FirstOrDefault();
var branch = root?.Children?.FirstOrDefault();

var groupEverything = Viewer.GroupManager.Everything;
var groupChild = Viewer.GroupManager.CreateEmptyGroup();
groupChild.Add(branch);

How can performance be improved? In our usecase this takes definitely to long.

Is there a way to run boolean operations on IVRGroups? E.g. addig/subtracting one group to/from another or getting the intersection of both?

gcorvala commented 6 years ago

Hi,

About the boolean operations support, could you please explain what you would like to achieve? Maybe we can suggest another way to achieve similar behavior.

About performance, did you use AddMany(IEnumerable branches) instead of Add(IVRBranch branch)?

kkneip commented 6 years ago

Hi,

regarding performance - I tested both, with the same results. I did not encounter any remarkable differences in execution times.

With boolean operations I meant an extended API for e,g. adding or substracting IVRGroup to/from each other or methods to get the intersection of two groups.

andgonro commented 6 years ago

Hello Kkneip,

Is the highlighting a requirement or would coloring be enough? We are working on improving a lot our coloring API and this might be able to help out in case highlighting is not needed. Regards,

kkneip commented 6 years ago

Hi,

the highlighting is required. We are going to implement a "multi-select" feature, when our plugin is active.

Regards,

andgonro commented 6 years ago

Hi Kkneip,

Are you working with local project or Online projects using the server? If you are working with Online or the final users will, then you may still take advantage of the new performance enhancements we have done. I think it worth to try. To give you an idea, selecting a full project takes on my side 25-30 seconds locally (sqlite db) and about 2-3 seconds when using the same project but online (SQL Server)

kkneip commented 6 years ago

Hi Andoni,

what do you mean by "Online projects" in detail? Projects provided via Webserver and displayed in desktop application or projects being used only in browser without any nativ client application?

During development we are using mainly local projects, but in production models should only be provided via Webserver.

When will the optimized version be available for testing?

Best regards, Karsten

andgonro commented 6 years ago

Online Project are the ones that are stored in the Walkinside Server. The next step is to have a look to see if this also happens with the Walkinside Server set up and we'll take a decision from there.