Runtime Profiling

Profiling Lynx

Following the instruction of Record Trace to profiling Lynx.

Profiling Framework

We provide the builtin trace points in frameworks like ReactLynx (Components' render and diff).

react profile

  • In development(rspeedy dev): ReactLynx-related trace points are added by default.
  • In production(rspeedy build): ReactLynx-related trace points are removed by default.

These tracing points show how components are rendered and diffed.

Run profiling in production

The trace points can be enabled by setting the performance.profile to true when build.

import { defineConfig } from '@lynx-js/rspeedy';

export default defineConfig({
  performance: {
    profile: true,
  },
});
TIP

You may use rspeedy preview to preview the output locally.

This is useful when trying to optimize the performance of the application.

WARNING

Do NOT deploy the output with performance.profile: true. They are not for production.

Disable profiling in development

The trace points can be disabled by setting the performance.profile to false when dev.

import { defineConfig } from '@lynx-js/rspeedy';

export default defineConfig({
  performance: {
    profile: false,
  },
});
Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.