Roadmap 0.10, Performance roadmap — wave 3
PERF.77 Code: PHP service layer: 1,457 prepare() with no shared helper, LibraryResult unused, 35 classes with their own ok()/fail(), components re-running one query
tools/perf/quality-php.php: the $st = db()->prepare(…); $st->execute([…]); $st->fetch(…) idiom appears 666 times across 204 classes, six classes define a private row() helper of their own, 626 hand-written ['ok' => …] results while LibraryResult exists and is used by zero classes. Pages where the controller and its components call the same service method with the same arguments more than once: /admin/library LibraryReports::countOpen() three times, /admin/messages Contact::countsByStatus() three times, /supercad SuperCadCheckout::seatsLeft() four times, the navbar Downloads::current() twice on every page. Change: db_row/db_rows/db_val/db_exec in core/functions/helpers.php and result_ok/result_fail (or adopt LibraryResult), added once (S) and adopted class by class as they are touched (M); pass page values down to components instead of re-querying. The SQL track's memo row covers the lookup side.
Community comments
No comments yet
Add detail as we go: how you would use it, files or steps that show the problem, what other programs do. The team reads every comment.
Sign in or create a free account to add a comment.