8000 remove some recursion when parsing chained OR/AND queries by ironage · Pull Request #6444 · realm/realm-core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

remove some recursion when parsing chained OR/AND queries #6444

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

Merged
merged 2 commits into from
Mar 28, 2023

Conversation

ironage
Copy link
Contributor
@ironage ironage commented Mar 27, 2023

Reported in #6428

This changes from a recursive call to using an iterative stack for LogicalNodes.

☑️ ToDos

  • 📝 Changelog update
  • 🚦 Tests (or not relevant)
  • C-API, if public C++ API changed.

Copy link
Member
@nicola-cab nicola-cab left a comment

Choose a reason for hiding this comment

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

LGTM, however, although this is much better, the code is still bound to whatever the memory limits are (which should be ok in most of the cases)... thanks for fixing this.

Copy link
Contributor
@jedelbo jedelbo left a comment

Choose a reason for hiding this comment

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

Excellent!

}

// exclude device tests due to large memory request for string query
#if !(REALM_IOS || REALM_ANDROID)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it actually too large to be run on device?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

TBH I haven't tried it. It requests around 0.6 Mb of contiguous memory which should actually be reasonable. I may have been overly cautious, I'll try it on CI and see what happens.

@ironage
Copy link
Contributor Author
ironage commented Mar 28, 2023

the code is still bound to whatever the memory limits are (which should be ok in most of the cases)...

The memory used now is a vector of pointers which is much smaller than a recursive call, so I'd expect that the first bottleneck will be for the string query itself.

Is it actually too large to be run on device?

Turns out it does work on our CI, so I'll keep the device tests enabled.

@ironage ironage merged commit 87ea815 into master Mar 28, 2023
@ironage ironage deleted the js/unroll-recursive branch March 28, 2023 17:14
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0