Ticket #1774 (closed task: done)
Getting instances of generic types through the ApplicationManager is slow when the debugger is attached
| Reported by: | abeham | Owned by: | abeham |
|---|---|---|---|
| Priority: | medium | Milestone: | HeuristicLab 3.3.7 |
| Component: | PluginInfrastructure | Version: | 3.3.7 |
| Keywords: | Cc: |
Description (last modified by abeham) (diff)
On my machine with the VS debugger attached, it takes roughly two minutes for the call to e.g. ApplicationManager.Manager.GetInstances<HeuristicOptimizationProblem<IEvaluator, ISolutionCreator>>() to complete (it should be equally slow for any generic type).
The performance issue seems to be in LightweightApplicationManager.CheckTypeCompatibility(Type type, Type other) as well as in the SandboxApplicationManager:
if (type.IsGenericType && other.IsGenericType) { try { if (type.IsAssignableFrom(other.GetGenericTypeDefinition().MakeGenericType(type.GetGenericArguments()))) return true; } catch (Exception) { } }
Without debugger attached there is no noticeable performance penalty. What is the reason for this rather steep drop in performance?
Attachments
Change History
comment:1 Changed 15 months ago by abeham
- Owner changed from gkronber to mkommend
- Status changed from new to assigned
- Description modified (diff)
comment:3 Changed 15 months ago by mkommend
- Priority changed from low to medium
- Milestone changed from HeuristicLab 3.3.x Backlog to HeuristicLab 3.3.7
comment:4 Changed 15 months ago by mkommend
r7492: Improved performance of type discovery for generic types.
Changed 15 months ago by mkommend
-
attachment
type discovery.patch
added
contains unit test and temporary implementation for reviewing purpose
comment:5 Changed 15 months ago by mkommend
- Owner changed from mkommend to abeham
- Status changed from accepted to reviewing
gkronber already had a brief look over the implemented changes
comment:6 Changed 15 months ago by abeham
- improved performance of type discovery by moving compatibility check further up the chain (deep cloneable unit test time reduced from 32s to 18s)
