> For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt.


# Analysis JavaScript

Trace supports recording detailed JavaScript profile data. A JavaScript Profile is a collection of stack traces sampled during execution, which is crucial for pinpointing performance hotspots and bottlenecks. This allows you to analyze [script](/next/guide/spec.md#javascript-script) execution performance.

### Click `JS Profile` and Select the correct scripts engine

Based on the background thread scripts engine used by your Lynx page, choose the appropriate value in the JS Profile selection.

- disable: Do not enable JavaScript profiling;
- [primjs](/next/guide/spec.md#primjs-vm): Enable profiling for the PrimJS JavaScript engine.
- [v8](/next/guide/spec.md#v8-javascript-core-quickjs-hermes-etc): Enable profiling for the V8 JavaScript engine.

![Choose JS Profile Type](https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/plugin/static/choose-js-profile-type-latest.png)
### Start recording

Click `Start` button to begin recording trace.

![Start Recording JavaScript Profile](https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/plugin/static/start-js-profile-trace-latest.png)
### Stop recording

When finished, click `Stop` button to end the recording.

![Stop Recording JavaScript Profile](https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/plugin/static/stop-js-profile-trace-latest.png)
### Decode JavaScript Profile Data using sourcemap (Optional)

If your scripts is [minified](https://rsbuild.rs/config/output/minify), you can use [sourcemap](/next/api/build/output/source-map.md) to decode profile data.

![Decode JavaScript Profile](https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/plugin/static/sourcemap-decode-latest.gif)

### FAQ

##### No JavaScript profile data after recording trace

- Make sure you have selected the correct script engine before starting recording.
- On iOS, ensure both Lynx DevTool and [PrimJS Debugging](/next/guide/start/integrate-lynx-devtool-advanced.md) are enabled.

##### No scripting resource found after clicking SourceMap Decode

- Ensure you start trace recording before opening the Lynx page so that the script resource name can be captured.
