Skip to content

Path based lookup - #193

Merged
skinkie merged 3 commits into
binary_relation_serializerfrom
enh_path_based_lookup
Oct 19, 2026
Merged

skinkie merged 3 commits into
binary_relation_serializerfrom
enh_path_based_lookup

Conversation

@skinkie

@skinkie skinkie commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

We have implemented in the past methods to identify location within objects. Likely due to bit rot or brain rot this lookup was not found anymore. Unlike attrgetter or the advanced method safe_attrgetter in this repository, we are only using integers. Hence the method is tied to the locally generated classes. The only location we actually store the paths now are in the unknown database.

When an unknown object is resolved, and their version or name_of_ref_class does not match. We want to update the reference to match the actual object. The current implementation iterates the entire object again, while this implementation knows exactly where in the object to look.

One could argue that if one object has multiple references, it could be more efficient to iterate over all references, but not in the implementation that currently remained. Benchmarking should still give an impression what improvements can be achieved using this new codepath. But it is the boilerplate to open the door for another fix.

recursive_attributes returns a numerical path to traverse the object
tree. While having implemented it, it has never been used in the current
code which still prefer to traverse through the entire object.

This commits lets the boiler plate and test to replace the iteration
over objects, and prefer the lookup.
If a reference has an invalid or missing nameOfRefClass-attribute, or
invalid version attribute, we here test if we correctly update/repair
the original reference.
We have implemented in the past methods to identify location within
objects. Likely due to bit rot or brain rot this lookup was not found
anymore. Unlike attrgetter or the advanced method safe_attrgetter in
this repository, we are only using integers. Hence the method is tied to
the locally generated classes. The only location we actually store the
paths now are in the unknown database.

When an unknown object is resolved, and their version or
name_of_ref_class does not match. We want to update the reference to
match the actual object. The current implementation iterates the entire
object again, while this implementation knows exactly where in the
object to look.

One could argue that if one object has multiple references, it could be
more efficient to interate over all references, but not in the
implementation that currently remained. Benchmarking should still give
an impression what improvements can be achieved using this new codepath.
But it is the boilerplate to open the door for another fix.
@skinkie
skinkie requested a review from ue71603 October 18, 2026 17:10
@skinkie skinkie self-assigned this Oct 18, 2026
@skinkie skinkie added the optimisation Everything related to optimisation label Oct 18, 2026
@skinkie
skinkie marked this pull request as draft October 19, 2026 07:28
@skinkie
skinkie removed the request for review from ue71603 October 19, 2026 07:28
@skinkie
skinkie force-pushed the enh_path_based_lookup branch from 8e23211 to 29935fc Compare October 19, 2026 07:31
@skinkie
skinkie requested a review from ue71603 October 19, 2026 07:32
@skinkie
skinkie marked this pull request as ready for review October 19, 2026 07:32

@ue71603 ue71603 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • manual review ok (as far as I understand it)
  • processing of some data tests seems to work

@skinkie
skinkie merged commit 2709a84 into binary_relation_serializer Oct 19, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

optimisation Everything related to optimisation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants