Skip to content

perf: DependencyObjectStore - #17827

Closed
Youssef1313 wants to merge 3 commits into
unoplatform:masterfrom
Youssef1313:actualinstance-perf
Closed

Youssef1313 wants to merge 3 commits into
unoplatform:masterfrom
Youssef1313:actualinstance-perf

Conversation

@Youssef1313

Copy link
Copy Markdown
Member

GitHub Issue (If applicable): closes #

PR Type

What kind of change does this PR introduce?

What is the current behavior?

What is the new behavior?

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

Internal Issue (If applicable):

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@Youssef1313
Youssef1313 force-pushed the actualinstance-perf branch 2 times, most recently from 4730bff to 02e4850 Compare August 4, 2024 07:29
@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot added the area/code-generation Categorizes an issue or PR as relevant to code generation label Aug 4, 2024
@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@Youssef1313
Youssef1313 force-pushed the actualinstance-perf branch from a6c52c7 to c7f66ef Compare August 4, 2024 11:22
@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot removed the area/code-generation Categorizes an issue or PR as relevant to code generation label Aug 29, 2024
@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@Youssef1313
Youssef1313 force-pushed the actualinstance-perf branch 2 times, most recently from 2b56f82 to 8904809 Compare August 30, 2024 08:04
@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot added the area/automation Categorizes an issue or PR as relevant to project automation label Aug 30, 2024
@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@Youssef1313
Youssef1313 marked this pull request as ready for review August 30, 2024 13:32
@Youssef1313

Copy link
Copy Markdown
Member Author

@MartinZikmund This PR was probably ready to merge as it was green. But the build is stale as it's quite old and there are now conflicts. The idea here is that using a WeakReference should only be required on iOS where circular references are problematic. Other platforms shouldn't use a WeakReference which has a slight performance impact.

@MartinZikmund MartinZikmund self-assigned this Nov 25, 2024
@github-actions

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or it will be closed in 10 days.

@github-actions github-actions Bot added the stale This item has been marked as stale and will be closed if there is no activity. label Feb 14, 2025
@github-actions

github-actions Bot commented Apr 5, 2025

Copy link
Copy Markdown
Contributor

This PR was closed because it has been stalled for 10 days with no activity.

@github-actions github-actions Bot closed this Apr 5, 2025
@MartinZikmund MartinZikmund removed the stale This item has been marked as stale and will be closed if there is no activity. label Apr 7, 2025
@MartinZikmund MartinZikmund reopened this Apr 7, 2025
@github-actions

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or it will be closed in 10 days.

@github-actions github-actions Bot added the stale This item has been marked as stale and will be closed if there is no activity. label Jul 16, 2025
@MartinZikmund

Copy link
Copy Markdown
Member

@ebariche is this perf PR still going to be included?

@jeromelaban

Copy link
Copy Markdown
Member

This change seems to be removing hard reference support, and I'm not sure it's worth it at this time.

@github-actions github-actions Bot removed the stale This item has been marked as stale and will be closed if there is no activity. label Jul 17, 2025
@github-actions

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or it will be closed in 10 days.

@github-actions github-actions Bot added the stale This item has been marked as stale and will be closed if there is no activity. label Sep 16, 2025
@MartinZikmund MartinZikmund removed the stale This item has been marked as stale and will be closed if there is no activity. label Sep 23, 2025
@github-actions

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or it will be closed in 10 days.

@github-actions github-actions Bot added the stale This item has been marked as stale and will be closed if there is no activity. label Nov 23, 2025
@github-actions

github-actions Bot commented Dec 4, 2025

Copy link
Copy Markdown
Contributor

This PR was closed because it has been stalled for 10 days with no activity.

@github-actions github-actions Bot closed this Dec 4, 2025
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 4, 2026
@MartinZikmund MartinZikmund removed the stale This item has been marked as stale and will be closed if there is no activity. label Jul 2, 2026
@MartinZikmund MartinZikmund reopened this Jul 2, 2026
@MartinZikmund

Copy link
Copy Markdown
Member

Closing this as superseded — thanks @Youssef1313, the idea landed, just by a different route.

Since this PR was opened, DependencyObjectStore was dissolved into DependencyObject itself (on feature/breakingchanges). The store and its owner are now the same object, so ActualInstance is literally => this — which gets what _hardOriginalObjectRef was after, without needing a second field at all.

The other half of this PR — DependencyPropertyDetailsCollection holding its owner strongly instead of through a pooled ManagedWeakReference — landed on dev/mazi/dostore-strongself:

  • refactor: Type the details-collection owner as DependencyObject
  • refactor: Remove the inert store hard-reference toggles (the TryEnableHardReferences/DisableHardReferences pair on that collection)
  • test: Pin DependencyObject collectibility with a strong store cycle — a When_Store_Populated_Then_Owner_Collected regression test that fails if the collection, or a closure capturing it, ever escapes its owner and pins the whole graph

The dead code this PR cleaned up as a consequence — the if (actualInstanceAlias != null) wrapper in InnerSetValue and its else { Parent = null; } fallback, plus the ! suppressions — was picked up there too, in refactor: Make ActualInstance non-nullable.

@jeromelaban, on the hard-reference concern from your review: it is preserved. Only the self hard reference went away, and only because it became inert once the store and the DO were the same object. The parent hard reference is untouched — _hardParentRef, FeatureConfiguration.DependencyObject.IsStoreHardReferenceEnabled and AreHardReferencesEnabled all still work, and a loaded element still pins its parent.

One note on the original motivation ("a WeakReference should only be required on iOS where circular references are problematic"): that constraint no longer applies now that the native iOS UI layer is gone, so the strong reference is unconditional rather than platform-gated.

@Youssef1313
Youssef1313 deleted the actualinstance-perf branch August 31, 2026 07:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area/automation Categorizes an issue or PR as relevant to project automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants