Profile performance after service cleanup

Combined findings for PR #10977, adjusted for PR #10994. Updated 15 October 2026.

Start from release plus service cleanup, then add the remaining performance improvements.

The implementation will use a new worktree created from origin/release-0.0.25. Pull hotfix/release-0.0.25/service-cleanup into that worktree before making the improvements below. This is the planned starting point; this report update does not create the worktree or integrate either branch.

Branch heads verified on 15 October 2026: release 8439db8ab6; service cleanup and PR #10994 f1a883efbd. Refresh the remote refs when implementation starts and record the actual combined baseline.

Included in the planned baseline

Service-cleanup changeHow subsequent work must treat it
Posts render independently of adsKeep fetchPostsWithSkyscraperAds() and late ad insertion across initial loads, pagination, and filters. Normal loading no longer waits for ads. Scroll and unlock restoration intentionally still wait to preserve list indexes.
Six modals deferred until idleKeep the existing modal defer block. Sidebar and welcome-video deferral remain separate improvements. Do not count the modal changes again as new work.
Subscription cleanupKeep the added teardown handling and replacement of the previous logged-in profile subscription. Preserve these changes when editing profile setup.

PR #10994 covers the earlier recommendation to separate feed loading from ads. It leaves the image, deployment cache, visible profile SSR, and CSS improvements available to implement.

Implementation order

  1. Refresh the remote refs, create the worktree from origin/release-0.0.25, and pull hotfix/release-0.0.25/service-cleanup. Complete the repository's skills-first workflow before implementation. Record measurements after this integration so improvements are compared against the correct baseline.
  2. Implement banner priority, tenant-safe logo sizing, and corrected S3 caching as independently reviewable changes.
  3. Trim Bootstrap CSS and defer the sidebar and welcome video. Preserve the modal defer block, component dependency imports, and sized placeholders.
  4. Implement visible profile SSR and consistent transferred-data consumption as a separate change. Keep authenticated refresh behavior and the baseline feed-loading logic intact.
  5. Consider secondary-request scheduling and the low-scoring items only where measurements show remaining value.

Adapt selected changes from PR #10977 against this combined baseline. Do not restore its posts-and-ads forkJoin in place of the service-cleanup helper. The earlier three-way text comparison found two conflict blocks in TypeScript, in RxJS imports and getOtherPosts(); the HTML merged cleanly. Reconcile behavior even where text merges automatically.

Original reviewer comparison: GPT-6.1-sol 8.5/10, Grok 4.6 6.5/10

The first review found more concrete adoption risks and made fewer unsupported claims. Grok gave a clearer rollout order and a useful warning about the video placeholder, but its Angular import advice would preserve a likely build failure.

ReviewMy ratingAssessment
A · GPT-6.1-sol8.5 / 10Stronger source analysis, cache and hydration reasoning, and calibration of expected gains.
B · Grok 4.66.5 / 10Useful prioritization and history checks. Several recommendations need correction before implementation.

These are my editorial ratings, weighted toward technical accuracy and adoption safety. Both reviewed the same checkout, 8439db8ab6, against PR head 37ac9de83d. Their different branch names do not explain the disagreements.

What decided the comparison

  1. Deferred component imports. A correctly flagged that the PR removes ProfileSidebarComponent and WelcomeVideoPostComponent while their selectors remain. B explicitly recommends removing the sidebar from the parent imports array. Keep the component dependencies declared; Angular generates the dynamic imports for eligible @defer content. See the official example and Angular 21 rules.
  2. SSR data handoff. A traced the specific problem: the PR uses PRERENDERED on the server and REFRESH_EVERY_N in the browser, but only the former reads this custom TransferState entry. B mentions hydration risk without explaining that mismatch. A provides the better starting point for a fix; runtime failure remains untested.
  3. Timeouts and existing skeletons. B says the new 8-second timeouts conflict with an existing 10-second timeout. That timeout only runs in PRERENDERED; the affected welcome-video and merchandise calls use REFRESH_EVERY_N, and other calls use the API service directly. B also misses the existing h-500 ad skeletons. A distinguishes existing height reservation from the PR's extra wrapper constraints.
  4. Cache rollout and image quality. B rightly makes HTML cache headers urgent. A goes further by noticing that the helper still makes all non-HTML files immutable and that unchanged objects may retain old metadata. A also questions blanket removal of 2× image variants. B's “take ... for sure” claim lacks device-density or visual evidence.

Remaining improvements after service cleanup

Scores are adoption value out of 10, including effort and risk, rather than measured speedups. A and B retain the original review scores. The final score reflects remaining value after integrating service cleanup. The optional-request score falls from 5 to 3 because feed/ad separation is already included.

ChangeA / B / remainingState after the planned integration and recommendation
Profile banner priority9 / 9 / 9The directive supports priority, but this banner is lazy. Enable eager loading and high fetch priority. A small change with plausible LCP value.
S3 cache headers6 / 9 / 9The upload path makes HTML immutable. Fix this early for update correctness. Revalidate HTML and mutable manifests; keep immutable caching for fingerprinted assets. Verify metadata on existing objects. Express's policy does not fix S3 uploads.
Visible profile SSR9 / 8 / 8The visible profile is browser-gated. Render public first-paint content on the server, consume the same transferred data on the client, then refresh personalized state. High upside; needs its own change and hydration checks.
Bootstrap CSS reduction7 / 8 / 7The full Bootstrap stylesheet remains. Audit class use across tenant layouts and compare compressed output. B's preference for @use fits current repo conventions, but the partial build still needs a real compilation check.
Defer sidebar and welcome video7 / 8, 7 / 7Service cleanup defers modals; these two components remain eager. Retain Angular dependency imports and use suitable loading triggers. Add a sized video placeholder. Preserve the modal defer block and inspect actual chunks; shared dependencies and idle prefetch affect savings.
Size the header logo7 / 6 / 7Optimization already defaults to WebP. Add sizing appropriate to the displayed logo and tenant aspect ratio. Explicit WebP alone adds no new benefit.
Delay secondary profile work6 / 7 / 6Delay analytics and optional requests selectively. Preserve the service-cleanup subscription handling and prompt post rendering. afterNextRender plus a timer does not prove that paint or LCP has finished. Avoid delaying content the user immediately needs.
Optional-request resilience5 / 2 / 3Normal feed/ad separation is included in the baseline. Investigate remaining slow tags, merchandise, welcome-video requests, and restoration paths. Add targeted fallbacks or time bounds only where justified; do not reintroduce a normal feed wait or blanket 8-second timeouts.
Ad skeleton wrapper heights3 / 6 / 3Both templates already request 500px skeletons. Extra block hosts and minimum heights may help specific layouts, but demonstrate a collapse or layout shift before prioritizing this.
Suppress priority-image 2× variants2 / 7 / 2Do not adopt globally. The current code conditionally offers a 2× candidate; the browser chooses an image. Tune delivered pixels to display size and device density, then compare bytes and sharpness.
Icon font swap2 / 5* / 2This changes the fallback behavior, not the font size. Check missing-glyph flashes before adopting. B grouped this with critical CSS, so its score is not directly comparable.
Early translation cookie— / 4 / 2B raises a possible returning-user translation flash. Keep this as a testable hypothesis. Neither review demonstrates a visible flash or a speed gain from restoring the shell script.

Already covered, or little value to port

ChangeCombinedDisposition
Third-party CDN cleanup and duplicate Roboto removal0Already present. B explicitly checked that 434d95ad91 is in the baseline history.
On-demand Google Translate0Already loads for a resolved non-English locale. Keep the newer implementation rather than restoring picker-open downloads.
Idle GTM / GA loading0Already implemented. The PR's documentation note adds no runtime improvement.
Explicit generated inlineCritical0Production and QA already enable it; tenant generation clones the configuration. The extra assignment is a safeguard rather than a demonstrated new gain.
Remove small WebSite JSON-LD0Keep valid structured data. Neither review establishes a useful performance case for deleting it.
Polyfills comment and existing theme-color change0No additional performance behavior to adopt.

Validation for the implementation

Measure before and after each improvement against the release-plus-cleanup baseline. Check profile LCP and layout shifts, compressed CSS and JavaScript output, image requests and sharpness across tenant logos, and actual deployed cache headers including unchanged objects and mutable manifests.

Exercise initial feeds, filters, pagination, delayed or failed ads, and scroll/unlock restoration. Check modal actions before and after idle loading, sidebar and video placeholders, and anonymous versus authenticated hydration. Run the applicable repository checks and builds with --max_old_space_size=10048; use the existing running app for browser checks.

Limits of both reviews

Neither produced before-and-after Lighthouse results, transfer-size comparisons, bundle measurements, or runtime hydration evidence. A states these limits more clearly. B uses stronger wording than its evidence supports, including “will CLS” for the video placeholder and certainty about skipping 2× images.

My comparison used both full activity timelines and their published reports, then spot-checked disputed findings against the stored baseline and PR commits. This revision also accounts for the inspected #10994 diff and verified branch heads. The review did not change application code or create an implementation worktree. No application build or performance test ran. The original report previews both failed because the host browser sandbox was blocked.

Source reports: A · B. Source checks: PR profile.component.ts, profile.component.html, upload helper; baseline api-cache.service.ts, image directive, skeleton templates and styles, angular.json, and tenant generator.