Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@driusan
Copy link
Collaborator

@driusan driusan commented Sep 23, 2024

The InstrumentQueryEngine converts the results of a query
that returns all values from an iterator to an array because
it's used twice. However, the second usage is unnecessary as the
data is available in another way. This switches the second usage
to be array_keys of a variable created in the first iteration and
removes the iterator_to_array, which should result in less memory
usage as it can be freed after the first iteration.

Dave MacFarlane added 2 commits September 23, 2024 11:02
The InstrumentQueryEngine converts the results of a query
that returns all values from an iterator to an array because
it's used twice. However, the second usage is unnecessary as the
data is available in another way. This switches the second usage
to be array_keys of a variable created in the first iteration and
removes the iterator_to_array, which should result in less memory
usage as it can be freed after the first iteration.
Copy link
Contributor

@kongtiaowang kongtiaowang left a comment

Choose a reason for hiding this comment

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

/var/www/Loris/modules/dataquery/php/query.class.inc on line 604 need to add "strval" as well.

@driusan
Copy link
Collaborator Author

driusan commented Sep 24, 2024

I did not touch that line because that whole section is rewritten by #9344 (which includes the strval) and would cause conflicts.

Copy link
Contributor

@kongtiaowang kongtiaowang left a comment

Choose a reason for hiding this comment

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

LGTM

@driusan driusan merged commit f8d2518 into aces:main Sep 24, 2024
ZhichGaming pushed a commit to ZhichGaming/Loris that referenced this pull request Nov 25, 2024
The InstrumentQueryEngine converts the results of a query
that returns all values from an iterator to an array because
it's used twice. However, the second usage is unnecessary as the
data is available in another way. This switches the second usage
to be array_keys of a variable created in the first iteration and
removes the iterator_to_array, which should result in less memory
usage as it can be freed after the first iteration.
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.

2 participants