RevitLookup icon indicating copy to clipboard operation
RevitLookup copied to clipboard

Slow responsiveness when Debugger is attached

Open guffab opened this issue 1 year ago • 11 comments

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?

guffab avatar May 15 '24 12:05 guffab

@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

Nice3point avatar May 15 '24 13:05 Nice3point

@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.

guffab avatar May 15 '24 13:05 guffab

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.

NeVeSpl avatar May 15 '24 16:05 NeVeSpl

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?

guffab avatar May 16 '24 05:05 guffab

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

Nice3point avatar May 16 '24 07:05 Nice3point

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

guffab avatar May 16 '24 09:05 guffab

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

Nice3point avatar May 16 '24 09:05 Nice3point

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 avatar May 16 '24 10:05 guffab

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

guffab avatar May 16 '24 10:05 guffab

@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 изображение

Nice3point avatar May 16 '24 13:05 Nice3point

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.

ricaun avatar May 17 '24 17:05 ricaun