Performance analysis
This tutorial guides you through optimizing mobile web applications with WebDebugX’s performance tooling. You will learn how to analyze CPU usage, memory consumption and rendering performance, and how to identify performance bottlenecks.
Overview
Section titled “Overview”WebDebugX’s performance tooling gives you comprehensive monitoring and analysis, helping you:
- Analyze CPU usage and hotspots
- Monitor memory usage and leaks
- Analyze page rendering performance
- Identify JavaScript performance bottlenecks
- Optimize resource loading and rendering
- Improve responsiveness and user experience
Tip: performance analysis works for every supported debugging target, including iOS Safari, iOS WebView, Android Chrome and Android WebView. Some metrics and analysis methods are platform-specific.
Starting a profiling run
Section titled “Starting a profiling run”- Connect your mobile device to the computer
- Select the target you want to debug in WebDebugX (a browser or an app)
- Click the Performance tab to open the performance panel
- Make sure Record performance is enabled
- Click Start recording to begin capturing performance data
CPU analysis
Section titled “CPU analysis”CPU analysis helps you understand where the application spends its time.
CPU usage
Section titled “CPU usage”- Overall CPU usage: the percentage of CPU the application is using
- CPU usage timeline: how CPU usage changes over time
- CPU usage distribution: how usage is distributed across threads or processes
JavaScript execution analysis
Section titled “JavaScript execution analysis”- In the performance panel, switch to the JavaScript tab
- View execution time and call count per function
- Identify long-running functions (hotspots)
- Analyze the call stacks and call relationships
Flame chart
Section titled “Flame chart”- In the performance panel, switch to the Flame chart view
- The flame chart shows the call stack and time distribution
- Width represents execution time, height represents call stack depth
- Colour distinguishes functions or modules
- Click a section of the chart to view details
JavaScript optimization suggestions
Section titled “JavaScript optimization suggestions”Based on the CPU analysis, WebDebugX suggests JavaScript optimizations:
- Identify frequently called functions and consider caching their results
- Find long-running functions and consider splitting or optimizing them
- Identify unnecessary computation or repeated work
- Suggest moving intensive computation into Web Workers
Memory analysis
Section titled “Memory analysis”Memory usage
Section titled “Memory usage”- Overall memory usage: how much memory the application uses
- Memory usage timeline: how memory usage changes over time
- Memory allocation: allocation broken down by object type
Heap snapshots
Section titled “Heap snapshots”- In the performance panel, switch to the Memory tab
- Choose the Heap snapshot analysis type
- Click Take snapshot to capture the current heap state
- Analyze object types, sizes and reference relationships in the heap
- Compare several snapshots to identify leaks
Allocation timeline
Section titled “Allocation timeline”- In the Memory tab, choose the Allocation timeline analysis type
- Click Start recording to begin capturing allocations
- Exercise the application
- Click Stop recording to finish
- Analyze the allocation timeline and patterns
Memory leak detection
Section titled “Memory leak detection”- Take an initial heap snapshot when the application starts
- Perform the operations you suspect of leaking
- Take another heap snapshot
- Compare the two snapshots and look for objects that keep growing
- Analyze the reference chains of those objects to find the source of the leak
Rendering performance analysis
Section titled “Rendering performance analysis”Frame rate analysis
Section titled “Frame rate analysis”- Live frame rate: the current frame rate
- Frame rate timeline: how frame rate changes over time
- Frame rate distribution: how frames fall across frame-rate ranges
- Dropped frame detection: identify frame-rate drops and dropped frames
Rendering timeline
Section titled “Rendering timeline”- In the performance panel, switch to the Rendering tab
- View the timeline of rendering events
- Analyze the layout, paint and composite stages
- Identify rendering bottlenecks and optimization opportunities
Layout thrashing analysis
Section titled “Layout thrashing analysis”- In the rendering timeline, look for frequent layout calculations
- Identify the JavaScript causing the thrashing
- Analyze why and how often layout is being recalculated
- Apply the suggested fixes — batch DOM operations, use CSS transforms, and so on
Rendering optimization suggestions
Section titled “Rendering optimization suggestions”- Reduce reflow and repaint
- Use CSS transform and opacity for animation
- Avoid forced synchronous layout
- Optimize CSS selectors
- Use
will-changeto hint the browser
Resource loading analysis
Section titled “Resource loading analysis”Resource loading timeline
Section titled “Resource loading timeline”- Load order: the chronological order in which resources load
- Load time: how long each resource takes
- Blocking analysis: which resources block rendering
- Dependencies: how resources depend on each other
Critical rendering path analysis
Section titled “Critical rendering path analysis”- In the performance panel, switch to the Critical path view
- See which CSS and JavaScript block rendering
- Analyze DOM and CSSOM construction
- Identify opportunities to shorten the critical rendering path
Resource optimization suggestions
Section titled “Resource optimization suggestions”- Optimize the resource loading order
- Load non-critical JavaScript asynchronously
- Inline critical CSS
- Compress and reduce resource sizes
- Use resource hints such as
preloadandprefetch
Performance metrics
Section titled “Performance metrics”Loading metrics
Section titled “Loading metrics”- First Contentful Paint (FCP): when content first appears
- Largest Contentful Paint (LCP): when the largest content element finishes rendering
- First Input Delay (FID): how long the page takes to respond to the first interaction
- Cumulative Layout Shift (CLS): a measure of visual stability
Optimization advice
Section titled “Optimization advice”- Reduce JavaScript execution time
- Optimize DOM operations
- Use Web Workers
- Implement code splitting
Resources
Section titled “Resources”- Compress and combine resources
- Use a CDN
- Preload resources
- Optimize image loading
Rendering
Section titled “Rendering”- Reduce reflow and repaint
- Use CSS animation
- Optimize layout calculation
- Implement virtual scrolling
Advanced features
Section titled “Advanced features”Performance comparison
Section titled “Performance comparison”- Compare performance between versions
- Analyze performance trends
- Set performance baselines
- Monitor for performance regressions
Custom analysis
Section titled “Custom analysis”- Create custom performance metrics
- Set performance alerts
- Export performance reports
- Integrate with performance monitoring
Troubleshooting
Section titled “Troubleshooting”Common problems
Section titled “Common problems”-
Performance data looks wrong
- Check the device state
- Confirm the analysis settings
- Restart the analysis
- Update WebDebugX
-
The analysis tool is unresponsive
- Check the device connection
- Restart the analysis tool
- Clear cached data
- Update to a newer version
-
Optimizations have no effect
- Re-check the optimization plan
- Analyze the bottleneck again
- Adjust the optimization strategy
- Run an A/B test
Best practices
Section titled “Best practices”- Profile regularly
- Establish performance baselines
- Monitor performance changes
- Keep optimizing incrementally