-
Notifications
You must be signed in to change notification settings - Fork 178
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
Conversation
There was a problem hiding this 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent!
test/test_parser.cpp
Outdated
} | ||
|
||
// exclude device tests due to large memory request for string query | ||
#if !(REALM_IOS || REALM_ANDROID) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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.
Turns out it does work on our CI, so I'll keep the device tests enabled. |
Reported in #6428
This changes from a recursive call to using an iterative stack for LogicalNodes.
☑️ ToDos