jeremytammik / RevitLookup

Interactive Revit RFA and RVT project database exploration tool to view and navigate BIM element parameters, properties and relationships.
http://thebuildingcoder.typepad.com
MIT License
1.11k stars 301 forks source link

View methods overloading low performance #239

Open Nice3point opened 6 months ago

Nice3point commented 6 months ago

Execution of some methods takes quite a long time, about 4 seconds which is critical

Method Screen
CanCategoryBeHidden (ElementId) изображение
IsCategoryOverridable (ElementId) изображение

The reason for this is the presence of DWG links inside the families:

изображение

Should these methods be disabled or are they informative and should be kept? In models without DWG they are executed 16 ms

ricaun commented 6 months ago

Maybe this methods that require category as input should be generated only if the user click in the method, if the project have a lot of categories RevitLookup is checking for each one even if the user does not need that information.

I wonder how many categories do you have in this 4 second sample.

ricaun commented 2 months ago

I found a similar issue that is forcing everything to be resolved when the RevitLookup is opened.

Would be make sense to have some other kind of resolver that is only resolve when the user click, like Invoker.

public interface IDescriptorInvoker : IDescriptorCollector
{
    Func<IVariants> Invoke(Document context, string target, ParameterInfo[] parameters);
}

That would be handy Resolve/Invoke some custom methods only when the user need/want.

Nice3point commented 2 months ago

@ricaun it is planned to add such a feature, though there is no certainty about the implementation and architecture design yet