Skip to content

perf: AllAttributesCache replace Lazy with laziliy initialised code - #2211

Merged
glennawatson merged 1 commit into
reactiveui:mainfrom
TimothyMakkison:lazy_attribute
Jul 13, 2026
Merged

glennawatson merged 1 commit into
reactiveui:mainfrom
TimothyMakkison:lazy_attribute

Conversation

@TimothyMakkison

@TimothyMakkison TimothyMakkison commented Jul 13, 2026 •

Copy link
Copy Markdown
Collaborator

Replace Lazy<object[]> with manual lazily initialised logic

  • When not called Lazy is a reference type using up 40 bytes, with an additional allocation of a 32 byte LazyHelper when called
  • Pre calculate the array length to avoid allocating an intermediary List.
    • If we are being performance obsessed here we could use a ValueListBuilder to avoid double looping Values.
  • Interlocked.CompareExchange might not be needed here, can remove.

@TimothyMakkison
TimothyMakkison marked this pull request as draft July 13, 2026 10:50
@TimothyMakkison
TimothyMakkison marked this pull request as ready for review July 13, 2026 11:00
@glennawatson
glennawatson merged commit b575c9d into reactiveui:main Jul 13, 2026
10 checks passed
@github-actions

Copy link
Copy Markdown

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jul 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants