Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep reference equality roundtripping maps and arrays through XPath #395

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DrRataplan
Copy link
Collaborator

This can improve performance because a map does not have to be copied a second time when returning
from XPath. It also makes the APIs easier to use because an entry in the map will be exactly the
same as the entry that was put in to engine as a variable.

This makes FontoXPath more predictable.

Relates to discussion #392

This can improve performance because a map does not have to be copied a second time when returning
from XPath. It also makes the APIs easier to use because an entry in the map will be exactly the
same as the entry that was put in to engine as a variable.

This makes FontoXPath more predictable
@DrRataplan DrRataplan force-pushed the map-array-reference-equality branch from 106b7f2 to 8516b44 Compare July 13, 2021 14:27
@DrRataplan
Copy link
Collaborator Author

This is a draft PR. I am aware naming is inconsistent. However, @JosVerburg @bwrrp, I think this PR can open up a lot of doors in fontoxpath-indices: more reference equality is usually more better.

@bwrrp
Copy link
Member

bwrrp commented Jul 13, 2021

That's a lot of code changes, I'll try to take a look in more detail later.

Am I correct in assuming that the array / object will only retain reference equality as long as it has not been modified? Does that also apply to sub-values (e.g., a map stored in an array where the array is modified, but the map is not)? That could definitely be useful to prevent deep equality checks when using XQuery to manipulate such data!

@DrRataplan
Copy link
Collaborator Author

DrRataplan commented Jul 13, 2021 via email

@DrRataplan
Copy link
Collaborator Author

Seems like some part of the compiler is very cross with me indeed. Might be some of the any I removed.

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.

None yet

2 participants