Roadmap 0.10, Performance roadmap — wave 3

PERF.54 Website: /library/kits takes 1.3 to 1.45 s and 496 queries; /library/addons 113 queries

  • Fix
  • Planned

FieldPacks::byId() iterates all(), which re-reads and re-checks 74 pack.json files (949 KB) per call, once per kit row (FieldPacks.php:116-137, library/section.php:162): about 5,500 json_decodes per request; coverage() asks AddonLibrary::byListingId per member (405 queries, FieldPacks.php:154) though AddonLibrary::all() is already cached. /library/addons: AddonLibrary::media() once per card (section.php:24, 93 queries). Fix: memoize FieldPacks::all() per request (a static cache like AddonLibrary::$cache), byId from that map, coverage() from AddonLibrary::all()[$mid]; one SELECT … WHERE listing_pk IN (…) for media (mediaCounts() already exists for counts). Expected: kits under 150 ms and about 20 queries. Note for bin/admin-perf.php: rewritten routes need the real file path (/library/section?section=kits).

Add a comment

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.