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.03k stars 294 forks source link

Slow responsiveness when Debugger is attached #237

Closed guffab closed 6 days ago

guffab commented 1 month ago

Hi,

I found "RevitLookup" to be a very handy tool for developing my own Revit plugin and I use it daily.

Although it is usually very responsive, it takes considerably longer per click (5-10 seconds) when I open Revit with the VS Debugger attached.

Any idea why that might happen?

Nice3point commented 1 month ago

@guffab during debug uses unoptimised code, any Debug build will be slower than Release. However 5-10 seconds is not normal, without more information there is no idea what the problem is

guffab commented 1 month ago

@Nice3point I think there is also a misunderstanding. I am not debugging the RevitLookup tool, but my own plugin. As far as I know, this should not have any affect on Revit or other plugins.

NeVeSpl commented 1 month ago

Plugins are running inside Revit process, debugger can be attached only to the whole process, therefore you are debugging every loaded assembly that is not build with optimization enabled or there are available debug symbols (*.pdb) for it.

guffab commented 1 month ago

So am I correct to assume the version of RevitLookup I installed was not built in Release Mode and it also includes .pdb files? Could this be the reason for the issue I am seeing?

I should also mention there is no issue with versions prior to Revit 2024. Maybe it has something to do with the UI change?

Nice3point commented 1 month ago

RevitLookup is published in Release mode, and does not ship with pdb files. If your plugin is not protected by NDA, you can send us the source code to understand what the problem is. We cannot answer your question without analysing it

guffab commented 1 month ago

Here is a bare-bones version of my plugin. To reproduce the issue:

  1. Unpack
  2. Open in Visual Studio
  3. Start with Debugger
  4. Open existing project or create a new one
  5. Select an element and click RevitLookup > Snoop Selection

ExamplePlugin.zip

Nice3point commented 1 month ago

@guffab the code is completely empty, it doesn't cause any problems, everything works fine as before during debugging изображение

guffab commented 1 month ago

Interestingly enough, on my PC (and those of my colleagues) there doesn't have to be any actual code in the project to reproduce it. Did you test it with the Visual Studio Debugger or only with Jetbrains Rider?

Snoop Selection of different elements and clicking on their Properties/Methods also works smoothly for you?

guffab commented 1 month ago

I just checked on another colleagues PC. He did not have this problem, but he also had an older version installed: image

After he updated, he had the same problem.


Here are two videos showing the difference (with and without Debugger):

https://github.com/jeremytammik/RevitLookup/assets/106798951/1a0d5323-1598-4221-8b94-46099f282cea

https://github.com/jeremytammik/RevitLookup/assets/106798951/844ce9d8-c9bd-4ba6-babc-af97d9447ef2

Nice3point commented 1 month ago

@guffab i see. indeed the slowdown in performance is felt quite critically.

Maybe Visual Studio users can help you, I use Jet Brains debugger and I can't test VS debugger. In my case this is not observed изображение

ricaun commented 1 month ago

I tested in Visual Studio 2022 with the last version (2024.1.4) and looks normal. I'm using Revit 2024.0.

Only the EventMonitor that is showing something in the console:

2024-05-17 14:00:14 [DBG] RevitLookup.Core.EventMonitor: RevitLookup EventMonitor: Autodesk.Revit.DB.Document.DocumentClosing
2024-05-17 14:00:14 [DBG] RevitLookup.Core.EventMonitor:  - success
...

Looks normal.