Skip to content

[Repo Assist] perf/refactor: convert ILFieldDefs/ILEventDefs/ILPropertyDefs to concrete classes with lazy name-lookup caches; add Dependabot c[Content truncated due to length]#503

Closed
dsyme wants to merge 1 commit intomasterfrom
repo-assist/improve-il-collection-dicts-20260409-616997fff531ec51
Closed

[Repo Assist] perf/refactor: convert ILFieldDefs/ILEventDefs/ILPropertyDefs to concrete classes with lazy name-lookup caches; add Dependabot c[Content truncated due to length]#503
dsyme wants to merge 1 commit intomasterfrom
repo-assist/improve-il-collection-dicts-20260409-616997fff531ec51

Conversation

@dsyme
Copy link
Copy Markdown
Contributor

@dsyme dsyme commented Apr 13, 2026

…rete classes with lazy name-lookup dictionaries; add Dependabot config

  • Convert ILFieldDefs, ILEventDefs, ILPropertyDefs from abstract interface types to concrete classes (mirroring the existing ILMethodDefs pattern). Each class holds a Lazy<T[]> and builds a lazy Dictionary<string, T> for O(1) TryFindByName lookups.

  • Update all instantiation sites (empty instances, seekReadFields, seekReadEvents, seekReadProperties, binary writer) to use the new constructors.

  • Add TryFindByName callers in TypeSymbol.GetField/GetPropertyImpl/GetEvent and TargetTypeDefinition.GetEnumUnderlyingType to replace O(n) Array.tryFind scans.

  • Add lazy fieldDefsMap/propDefsMap/eventDefsMap in TargetTypeDefinition for O(1) single-member lookup in GetField/GetPropertyImpl/GetEvent.

  • Lazy evaluation of Entries also means repeated .Entries accesses on seekRead-produced ILFieldDefs/ILEventDefs/ILPropertyDefs no longer re-read the underlying metadata on each call.

  • Also: add .github/dependabot.yml for weekly GitHub Actions updates.

  • Fix typo: 'occured' -> 'occurred' in error message.

126/126 tests pass.

…rete classes with lazy name-lookup dictionaries; add Dependabot config

- Convert ILFieldDefs, ILEventDefs, ILPropertyDefs from abstract interface
  types to concrete classes (mirroring the existing ILMethodDefs pattern).
  Each class holds a Lazy<T[]> and builds a lazy Dictionary<string, T>
  for O(1) TryFindByName lookups.

- Update all instantiation sites (empty instances, seekReadFields,
  seekReadEvents, seekReadProperties, binary writer) to use the new
  constructors.

- Add TryFindByName callers in TypeSymbol.GetField/GetPropertyImpl/GetEvent
  and TargetTypeDefinition.GetEnumUnderlyingType to replace O(n)
  Array.tryFind scans.

- Add lazy fieldDefsMap/propDefsMap/eventDefsMap in TargetTypeDefinition
  for O(1) single-member lookup in GetField/GetPropertyImpl/GetEvent.

- Lazy evaluation of Entries also means repeated .Entries accesses on
  seekRead-produced ILFieldDefs/ILEventDefs/ILPropertyDefs no longer
  re-read the underlying metadata on each call.

- Also: add .github/dependabot.yml for weekly GitHub Actions updates.

- Fix typo: 'occured' -> 'occurred' in error message.

126/126 tests pass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dsyme dsyme closed this Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant