Skip to content

v1.0.3 - Performance Optimization (16 bottlenecks fixed)

Latest

Choose a tag to compare

@bivex bivex released this 06 Aug 14:00
· 2 commits to main since this release

Release v1.0.3 β€” Comprehensive Performance Optimization

πŸ”΄ Critical Fixes

  • TypeSummary DTO: ListTypes and AnalyzeAssembly now use a lightweight TypeSummary (no member mapping) instead of full TypeInfo β€” eliminates mapping of all methods/properties/fields/events just to list type names
  • Single-pass TotalTypeCount: Previously enumerated all TypeDefinitions twice; now counted in the same loop as public type selection
  • Single-pass DirectBaseTypes: Previously iterated twice (once for base classes, once for interfaces); now partitioned in one loop

🟠 High Impact Fixes

  • TTL-based file stat cache: File.GetLastWriteTimeUtc now checked at most once every 5 seconds per assembly path (was a syscall on every single service method call)
  • memberKind flags pre-resolved: In SearchMembers, all 4 string comparisons now resolved once before the type loop (was evaluated per-type β€” 2000+ redundant comparisons on CoreLib)
  • BuildMethodSignature with StringBuilder: Replaces string.Join(", ", method.Parameters.Select(...)) with a direct StringBuilder loop β€” no LINQ iterator allocation per method
  • SearchMembers result cap: Hard cap at 200 results with early exit β€” prevents unbounded allocations on common search terms
  • TimeoutService rewrite: Single CancellationTokenSource per request via new CreateLinkedTimeout() API β€” eliminates 2–3 CTS allocations + leaks per request
  • Cached TimeSpan: DefaultTimeout computed once in constructor, not on every request

🟑 Medium Fixes (All UseCases)

  • .Any() β†’ .Count > 0: All .Any() calls on materialized IReadOnlyList<T> replaced β€” eliminates LINQ enumerator allocations
  • AccessibilityLabel() switch: Replaces .ToString().ToLower() on accessibility enum per member β€” pre-computed strings, zero allocations
  • Zero-alloc modifier string: GetTypeMembers method modifier building replaces new List<string>() + string.Join per method with a ternary chain
  • TypeKind inline switch: ListTypes kind label replaces .ToString().ToLower() per type with explicit string literals