dlr-gtlab / gtlab-core

GTlab Core Framework
https://www.gtlab.de
Other
7 stars 2 forks source link

🐛 [BUG] - Objectlink object selection via search is very slow #1206

Closed jensschmeink closed 2 weeks ago

jensschmeink commented 4 months ago

Summary

Search is very slow espacially for huge projects

Expected Behaviour

faster search

Reproduction steps

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

Screenshots

No response

Logs

No response

GTlab environment

GTlab Version: X.Y.Z
Module 1 Version: X.Y.Z
Module 2 Version: X.Y.Z

OS

Windows

jensschmeink commented 2 months ago

A first callgrind test shows some effort to ask every object of the data model for its metaobject. This happens here: https://github.com/dlr-gtlab/gtlab-core/blob/master/src/gui/dock_widgets/properties/editors/gt_propertyobjectlinkeditor.cpp#L207

Currently I see no simple solution to get rid of this.

rainman110 commented 2 months ago

A first callgrind test shows some effort to ask every object of the data model for its metaobject. This happens here: https://github.com/dlr-gtlab/gtlab-core/blob/master/src/gui/dock_widgets/properties/editors/gt_propertyobjectlinkeditor.cpp#L207

Currently I see no simple solution to get rid of this.

How many objects need to be checked? How often is accumulateAllowedObjects called? I have the impression, that the function does more than required, i.e. is called too often. Ideally, each objects is traversed only once.

jensschmeink commented 2 months ago

I'm not an expert about the callgrind usage but my new test showed more than 10 million calls of GtdPointF::metaObject() while adding an "E" to the search line edit and remove it again. But the trace is not that clear

rainman110 commented 2 months ago

I'm not an expert about the callgrind usage but my new test showed more than 10 million calls of GtdPointF::metaObject() while adding an "E" to the search line edit and remove it again. But the trace is not that clear

Do we have that many objects? This seems to me a bit too many calls.