QueryFactory currently resolves query file paths by scanning the query directory with DirectoryIterator on each query lookup. In workloads that execute many small queries inside large loops, this repeatedly opens the same directory and re-scans its contents even when the query names are stable.
This is not necessarily the root cause of file descriptor exhaustion in consuming applications, but it does increase open-file churn and makes the library less efficient than it needs to be.
For directory-backed query collections, QueryFactory::findQueryFilePathInDirectory() iterates the directory on each query lookup:
src/Query/QueryFactory.php:59
src/Query/QueryFactory.php:66
That means repeated calls such as:
$db->fetchString("card/getSomething", $id);
$db->fetchString("card/getAnotherThing", $id);
will repeatedly re-open and scan the same card/ query directory
QueryFactorycurrently resolves query file paths by scanning the query directory withDirectoryIteratoron each query lookup. In workloads that execute many small queries inside large loops, this repeatedly opens the same directory and re-scans its contents even when the query names are stable.This is not necessarily the root cause of file descriptor exhaustion in consuming applications, but it does increase open-file churn and makes the library less efficient than it needs to be.
For directory-backed query collections,
QueryFactory::findQueryFilePathInDirectory()iterates the directory on each query lookup:src/Query/QueryFactory.php:59src/Query/QueryFactory.php:66That means repeated calls such as:
will repeatedly re-open and scan the same card/ query directory