PromptBase
Upgrade
Close icon
General
Home
Marketplace
Create
Hire
Login
Chat
Sell
Explore

Prompt Details

Model
(claude-5-5-sonnet)
Token size
5,812
Example input
[Describe the website or web application, framework, browser, operating system, device class, affected page, and relevant implementation details.]: React-based e-commerce website [Provide Chrome DevTools Performance trace screenshots, exported trace files, flame-chart observations, performance recordings, event timings, or relevant trace excerpts.]: A simulated browser trace shows frequent style recalculation, repeated chart redraws, and periodic garbage collection. [Provide interaction latency, frame timing, long-task observations, LCP, INP, CLS, scripting duration, layout duration, paint duration, or other available measurements.]: INP = 380 ms, LCP = 3.1 seconds, CLS = 0.08. [Describe CPU throttling, viewport size, device characteristics, browser version, cache state, network conditions, extensions, workload, and test repeatability.]: Average frame interval = 28 ms during the affected scroll; date-range update = 1.4 seconds; dashboard LCP = 2.7 seconds; CLS = 0.03. [Provide acceptable latency, target frame rate, device support, accessibility requirements, code-change restrictions, deadline, and measurable success criteria.]: Achieve smooth scrolling near the device's refresh-rate frame budget and reduce date-range update latency to below 500 ms.
Example output
## πŸ” PHASE 1 β€” Performance Context Reconstruction Investigation scope: Product-color selection on a React e-commerce page. 1. The user clicks a color option. 2. JavaScript processes the event. 3. React updates application state and renders affected components. 4. The browser recalculates styles, performs layout, paints changes, and presents the updated color. Known facts from the test input: - The visual update takes approximately 850 ms. - A JavaScript task lasts 420 ms. - Repeated layout events and multiple component updates appear in the simulated trace. - The reported INP is 380 ms. Initial hypotheses: - H1: Expensive JavaScript blocks the main thread. - H2: Repeated layout calculations delay presentation. - H3: Unnecessary React updates add work. - H4: More than one bottleneck contributes to the delay. Missing evidence: Full trace timestamps, call stacks, layout durations, component-profiler data, and repeated-run measurements. Priority: Investigate the long JavaScript task first, then establish whether layout and component updates materially contribute. ## πŸ“Š PHASE 2 β€” Baseline and Measurement Quality Audit | Metric | Test value | Interpretation | | --------------- | ---------- | -------------------------------------- | | Color update | 850 ms | Reported visual response delay | | JavaScript task | 420 ms | Potential main-thread blocking | | INP | 380 ms | Poor interaction responsiveness | | LCP | 3.1 s | Room for loading improvement | | CLS | 0.08 | Within the usual good threshold of 0.1 | Analysis: - INP of 380 ms exceeds the recommended good threshold of 200 ms. - LCP of 3.1 seconds exceeds the good threshold of 2.5 seconds. - CLS of 0.08 is within the good threshold of 0.1. - The 850 ms visual response and 380 ms INP need to be reconciled because they may use different timing boundaries or measurement methods. Result: The page has an interaction responsiveness problem. The precise cause remains unconfirmed. ## 🧭 PHASE 3 β€” Browser Trace and Flame-Chart Reconstruction The simulated trace contains a 420 ms JavaScript task, repeated layout events, and multiple component updates. | Observation | Potential consequence | Confidence | | -------------------------- | ---------------------------------------- | --------------------------- | | 420 ms JavaScript task | Delays other main-thread work | High that it is a long task | | Repeated layout events | Possible redundant geometry calculations | Medium | | Multiple component updates | Possible unnecessary rendering work | Low to medium | | 850 ms visual response | Indicates a substantial delay | High, based on the input | Investigation steps: 1. Inspect the JavaScript task's call stack. 2. Record its start time, duration, and self time. 3. Inspect the sequence of layout and style-recalculation events. 4. Determine whether the layout events occur within the same interaction. 5. Inspect the interval between event processing and visual presentation. Result: The trace suggests several possible bottlenecks, but does not establish which one causes most of the delay. ## 🧡 PHASE 4 β€” Main-Thread Blocking and JavaScript Analysis Hypothesis H1: An expensive synchronous operation blocks the browser's main thread. Diagnostic experiment: 1. Record ten color-selection interactions under controlled conditions. 2. Identify the longest task associated with each interaction. 3. inspect the call stack of the 420 ms task. 4. Temporarily optimize the suspected function in a test branch. 5. Repeat the same interactions and compare the results. Potential fixes, depending on evidence: - Remove repeated calculations. - Reduce unnecessary DOM traversal. - Break up long noncritical work. - Move suitable CPU-intensive calculations to a Web Worker. - Defer nonessential processing until after immediate visual feedback. Trade-off: Breaking work into smaller tasks may improve responsiveness, but does not necessarily reduce total CPU usage. Success criterion: The long task no longer delays the color-selection interaction, and measured interaction latency improves without functional regressions. ## πŸ“ PHASE 5 β€” Style Recalculation and Layout Investigation Hypothesis H2: The color-selection handler triggers unnecessary layout calculations. Inspect for patterns such as: - Reading `getBoundingClientRect()` after modifying the DOM. - Reading `offsetWidth` repeatedly inside loops. - Alternating DOM writes and geometry reads. - Updating layout-affecting styles across many product components. Diagnostic experiment: 1. Capture the relevant JavaScript call stacks. 2. Identify forced synchronous layout, if present. 3. Batch geometry reads before DOM writes. 4. Repeat the same interaction and compare layout duration and event latency. Potential fix: Reuse geometry measurements and batch DOM changes where the application requires them. Important: Repeated Layout events alone do not prove layout thrashing. Their duration and relationship to DOM mutations must be established. ## 🎨 PHASE 6 β€” Paint, Rasterization, and Compositing The input does not provide measured paint, rasterization, or compositing durations. Investigation plan: - Inspect paint events following the color-selection interaction. - Check whether large portions of the product page are repainted. - Examine whether changing the color also updates large images, shadows, filters, or other expensive visual effects. - Determine whether compositing or GPU resource pressure contributes to presentation delay. Potential optimization: Limit visual updates to the elements that actually need to change. Avoid: Adding `will-change` to every color swatch or forcing compositing without evidence. Result: Paint and compositing remain unverified hypotheses. ## πŸ–±οΈ PHASE 7 β€” Input Handling and Interaction Responsiveness Separate the interaction into three components: 1. Input delay: Time before the browser begins processing the click. 2. Processing duration: Time spent executing the interaction's event handlers. 3. Presentation delay: Time between completing processing and displaying the result. Experiment: - Measure each component using browser event timing. - Display the selected color immediately when appropriate. - Defer nonessential recommendations, analytics, or secondary calculations. - Verify that deferred work does not cause incorrect or out-of-order product updates. Expected benefit: The user should receive visual feedback promptly, even if secondary work continues afterward. Success criterion: The measured interaction approaches the 200 ms target without sacrificing correctness. ## 🧩 PHASE 8 β€” DOM Size and React Rendering Hypothesis H3: Selecting a color updates more React components than necessary. Investigation: - Use React DevTools Profiler to inspect the affected component tree. - Check whether unrelated product cards, descriptions, reviews, or recommendations rerender. - Inspect state placement and component dependencies. - Determine whether repeated calculations occur during rendering. Potential fixes: - Keep color-selection state close to the components that need it. - Memoize expensive computations when profiling justifies it. - Stabilize props where this prevents costly unnecessary updates. - Virtualize large lists only if list rendering is shown to be a significant cost. Trade-off: Memoization introduces complexity and memory overhead, so it should be applied selectively. Result: Multiple component updates are observed in the test input, but their cost and necessity are not yet known. ## 🎞️ PHASE 9 β€” Frame Timing, Animation, and Scrolling No frame-interval or dropped-frame measurements are supplied. Test plan: 1. Record frame timings during repeated color changes. 2. Identify whether the page uses transitions or JavaScript-driven animations. 3. Check for layout work occurring on every animation frame. 4. Compare the same interaction with nonessential animations temporarily disabled. 5. Verify behavior at the device's actual refresh rate. Potential improvements: - Avoid repeated layout reads and writes inside animation callbacks. - Use transforms or opacity for suitable animations. - Reduce unnecessary per-frame computation. Result: Frame drops and animation bottlenecks cannot yet be confirmed. ## 🧠 PHASE 10 β€” Resource Loading and Initial Rendering The slow color-selection interaction and the 3.1-second LCP represent different performance concerns. Investigation plan: - Inspect the LCP element and its resource-loading timeline. - Measure image download and decoding time. - Examine JavaScript bundle size and startup execution. - Check whether hydration or initialization blocks interaction. - Inspect image requests triggered by selecting a new color. Potential fixes: - Prioritize the actual LCP resource. - Optimize product-image dimensions and formats. - Defer noncritical scripts. - Avoid downloading every color variant immediately if evidence shows unnecessary resource loading. Result: LCP needs separate investigation. Its value does not establish the cause of the slow color-selection interaction. ## πŸ”— PHASE 11 β€” Third-Party Scripts and Background Contention Potential contributors include analytics, tag managers, chat widgets, and other third-party scripts. Controlled experiment: 1. Use a safe test environment. 2. Record color-selection latency with the normal application configuration. 3. Disable one suspected third-party dependency. 4. Repeat the same test under equivalent conditions. 5. Compare the main-thread tasks and interaction timings. Decision rule: Attribute the slowdown to a dependency only when the evidence demonstrates a meaningful causal relationship. Result: No third-party cause has been established. ## πŸ§ͺ PHASE 12 β€” Root-Cause Hypotheses and Experiments | ID | Hypothesis | Confidence | Next experiment | | -- | ----------------------------------------------- | ------------------------------------------------------------------- | ---------------------------------------------- | | H1 | Long JavaScript execution blocks responsiveness | High that blocking exists; medium that it explains the entire delay | Profile the 420 ms task | | H2 | Layout work adds interaction delay | Medium-low | Inspect layout events and geometry reads | | H3 | Unnecessary React updates increase processing | Low-medium | Profile the component tree | | H4 | Several bottlenecks combine | Medium | Correlate all three stages in a complete trace | Experiment priority: 1. Profile the long JavaScript task. 2. Test the highest-cost function or operation identified in its call stack. 3. Investigate layout only after establishing its duration and causal relationship. 4. Profile React updates and test targeted changes. 5. Repeat the full interaction benchmark after each meaningful modification. Result: H1 is the strongest initial lead because the test explicitly supplies a 420 ms JavaScript task. Its causal contribution still requires confirmation. ## βš–οΈ PHASE 13 β€” Optimization Trade-Offs and Regression Risk | Proposed change | Potential benefit | Main risk | | --------------------------------- | ---------------------------- | --------------------------------------------------- | | Reduce expensive synchronous work | Improved responsiveness | Incorrect ordering if work is deferred improperly | | Batch layout reads and writes | Less unnecessary layout work | Incorrect measurements if layout assumptions change | | Localize React state | Fewer unrelated updates | More complicated state coordination | | Optimize critical product images | Improved loading performance | Image quality or compatibility regressions | | Simplify expensive visual effects | Lower paint cost | Changes to the intended design | Engineering rule: Do not implement all optimizations at once. Change one important variable at a time where practical, then compare results. ## πŸ“ˆ PHASE 14 β€” Prioritized Optimization Blueprint OPT-01: Investigate the 420 ms JavaScript task Priority 1 Effort: Medium Β· Risk: Low for profiling Identify the expensive operation and validate a targeted fix against the original interaction. OPT-02: Verify and reduce unnecessary layout work Priority 2 Effort: Medium Β· Risk: Medium Batch geometry reads and writes if the trace confirms avoidable layout calculations. OPT-03: Reduce costly React updates Priority 3 Effort: Medium Β· Risk: Medium Localize state or optimize rendering only where the React Profiler identifies meaningful overhead. OPT-04: Validate loading and visual-pipeline performance Priority 4 Effort: Depends on evidence Β· Risk: Depends on implementation Investigate LCP, paint, rasterization, and frame timing as separate performance objectives. The 200 ms interaction target is a test objective, not a guaranteed outcome. Each proposed fix must be measured. ## πŸ› οΈ PHASE 15 β€” Validation and Regression Testing Use a repeatable before-and-after test. Procedure: 1. Fix the browser version, viewport, test data, and CPU conditions. 2. Keep cache and network conditions consistent. 3. Execute the same color-selection sequence at least ten times per configuration, increasing repetitions if variability remains high. 4. Compare the median and distribution of interaction latency. 5. Record INP where the measurement method supports it. 6. Compare JavaScript task duration, layout duration, and frame timing. 7. Check product-image correctness, keyboard navigation, accessibility, and rapid successive selections. 8. Repeat on representative mobile and desktop devices. Acceptance criteria: - The color-selection response reaches the target of 200 ms or less under the agreed test conditions. - No functional or accessibility regressions occur. - The measured improvement is repeatable. - LCP and CLS do not materially regress. - The results and remaining uncertainty are documented. A single successful recording is not enough to establish a reliable improvement. ## πŸ† PHASE 16 β€” Final Browser Performance Investigation Report ### A. Executive Summary The simulated e-commerce page has slow color-selection interactions, a reported 850 ms visual response, and a 420 ms JavaScript task. The strongest initial lead is main-thread blocking. ### B. Reproduction and Environment - Scenario: Select a product color on a React product page. - Browser: Chrome on a mid-range Android device. - Missing details: Exact Chrome version, device specifications, viewport, and CPU throttling. ### C. Baseline and Trace Evidence - Visual response: 850 ms. - JavaScript task: 420 ms. - INP: 380 ms. - LCP: 3.1 seconds. - CLS: 0.08. These are simulated input values. No actual trace file or recording has been examined. ### D. Rendering Pipeline Diagnosis - Main-thread JavaScript: Long task reported. - Style and layout: Repeated layout events reported; cost unknown. - Paint and compositing: Insufficient evidence. - Frame scheduling: Insufficient evidence. ### E. Ranked Root-Cause Register 1. H1: Main-thread blocking is the leading candidate. 2. H2: Layout work may contribute. 3. H3: React updates may add unnecessary processing. 4. H4: Multiple contributing bottlenecks remain possible. ### F. Interaction and Framework Analysis The interaction timing must be separated into input delay, processing duration, and presentation delay. React profiling is needed to determine the actual cost of component updates. ### G. Resource and Third-Party Analysis LCP indicates a separate loading concern. No evidence currently attributes the interaction slowdown to third-party scripts or resource loading. ### H. Optimization Recommendations Begin by profiling the long JavaScript task. Proceed to layout and React optimizations only when their contribution is demonstrated. ### I. Experiment Plan Run controlled profiling sessions, test one targeted change at a time, and compare equivalent traces. ### J. Implementation Roadmap - First: Obtain and analyze the full trace. - Second: Test the highest-confidence JavaScript fix. - Third: Verify layout and React rendering costs. - Fourth: Optimize other confirmed bottlenecks. - Fifth: Repeat regression and cross-device testing. ### K. Validation and Regression Plan Use repeatable measurements, compare before-and-after latency distributions, verify functionality and accessibility, and document the test environment. ### L. Remaining Unknowns - Full trace and JavaScript call stacks. - Layout and paint durations. - React Profiler recordings. - Exact measurement boundaries for the 850 ms response. - Device and test-run variability. - Product-image loading behavior during color changes. ### M. Final Engineering Verdict 1. Strongest finding: The test input reports a 420 ms JavaScript task. 2. Most likely bottleneck: Main-thread blocking is the leading candidate, but causation is unconfirmed. 3. Next experiment: Inspect the task's call stack and correlate it with the color-selection event. 4. Highest-value candidate: Reduce the expensive synchronous work identified through profiling. 5. Key regression risk: Breaking product-state updates or changing the order of visual feedback. 6. Success condition: Repeatably achieve a color-selection response of 200 ms or less under controlled conditions, with no material correctness, accessibility, or loading regressions. Final status: INSUFFICIENT EVIDENCE β€” ADDITIONAL PROFILING REQUIRED. ## βœ… Overall Test Evaluation Phase coverage ## 16/16 All 16 phases have been exercised using the supplied simulated scenario. Evidence discipline Pass Missing measurements were not invented, hypotheses were separated from confirmed findings, and proposed fixes include validation criteria. Production diagnosis Not yet verified A real Chrome DevTools trace and repeatable benchmark results are required before declaring a root cause or claiming a speed improvement.
Claude

Browser Rendering Bottleneck Investigato

Add to Cart
Instant accessInstant access
Usage rightsCommercial use
Money-back guaranteeMoney‑back
By purchasing this prompt, you agree to our terms of service
CLAUDE-5-5-SONNET
Tested icon
Guide icon
4 examples icon
Free credits icon
Browser Rendering Bottleneck Investigator helps developers investigate these problems using actual browser profiling evidence instead of guessing or applying generic optimization tips. πŸ› οΈ Create a prioritized optimization plan with regression checks. 🧡 Identify main-thread blocking and long-running Java Provide your browser profiling evidence, affected interaction, and performance measurementsβ€”and turn them into an evidence-backed rendering diagnosis and actionable frontend optimization plan.
...more
Added 1 hour ago
Report
Browse Marketplace