# Can DeepSeek-Reasonix Be Used for Performance Analysis? A Complete Technical Guide

> Discover if DeepSeek-Reasonix aids performance analysis. Learn how its built-in reporting captures runtime metrics like heap usage and GC cycles for clear insights. A full technical guide.

- Repository: [YHH/DeepSeek-Reasonix](https://github.com/esengine/DeepSeek-Reasonix)
- Tags: how-to-guide
- Published: 2026-06-26

---

**Yes, DeepSeek-Reasonix includes a built-in performance-reporting pathway that captures native runtime metrics (heap usage, GC cycles, goroutine count) and forwards them as structured crash reports for systematic analysis.**

DeepSeek-Reasonix is an open-source monitoring framework that provides crash reporting and error tracking capabilities. While primarily designed for exception handling, the repository contains a dedicated **performance analysis** channel that treats performance data as first-class reports, enabling you to monitor application health alongside traditional crash data.

## How DeepSeek-Reasonix Captures Performance Data

The architecture treats performance events identically to crashes, using the same ingestion pipeline while enriching reports with native runtime context.

### The Performance Payload Format

The frontend initiates performance tracking by sending a JSON payload with `SchemaVersion: 2` and `Kind: "performance"`. According to the DeepSeek-Reasonix source code in [`desktop/crash_app.go`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/desktop/crash_app.go), the `crashReportFromDetail` function parses this payload and validates the report type using `normalizeReportKind` (lines 4-8).

### Native Runtime Context Injection

When the backend detects a performance report, it triggers `appendNativeResourceContext` (lines 85-90 in [`desktop/crash_app.go`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/desktop/crash_app.go)). This function automatically enriches the `message` field with Go runtime statistics captured by `nativeResourceContext`:

- **Go heap alloc**: Current heap allocation
- **Go heap sys**: Heap system memory
- **Go total sys**: Total system memory
- **Goroutines**: Active goroutine count
- **GC cycles**: Number of completed garbage collection cycles

The enriched report is then forwarded to `https://crash.reasonix.io/v1/report` via `ReportCrash` and `postCrashReport` (lines 44-54), making it available for storage, querying, and visualization alongside crash and exception data.

## Sending Performance Reports from the Frontend

You can trigger performance analysis by sending a structured payload from your JavaScript frontend. The backend will automatically append native runtime metrics before forwarding to the crash endpoint:

```javascript
fetch('https://your-reasonix-instance/api/report', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    schemaVersion: 2,
    kind: 'performance',
    source: 'frontend.performance',
    label: 'performance.pressure',
    message: '[performance.pressure]\n\n--- performance context ---\nreason: event loop lag 1300ms',
    errorType: 'PerformancePressure',
    errorMessage: 'UI responsiveness degraded because the app observed long tasks, event-loop lag, or high JS heap pressure.',
    topFrame: 'frontend.performance'
  })
})

```

After ingestion, the final `Message` field in the crash report will contain both your frontend context and the native runtime metrics:

```text
[performance.pressure]

--- performance context ---
reason: event loop lag 1300ms

--- native runtime context ---
go heap alloc: 12.3 MB
go heap sys: 15.6 MB
go total sys: 31.2 MB
goroutines: 7
gc cycles: 3

```

## Processing Performance Reports on the Backend

The Go backend handles performance reports through the same pipeline as crashes. You can verify this behavior using the unit test pattern found in [`desktop/crash_app_test.go`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/desktop/crash_app_test.go) (lines 51-66):

```go
payload := frontendCrashPayload{
    SchemaVersion: 2,
    Kind:          "performance",
    Source:        "frontend.performance",
    Label:         "performance.pressure",
    Message:       "[performance.pressure]\n\n--- performance context ---\nreason: event loop lag 1300ms",
    ErrorType:     "PerformancePressure",
    ErrorMessage:  "UI responsiveness degraded because the app observed long tasks, event-loop lag, or high JS heap pressure.",
    TopFrame:      "frontend.performance",
}
detail, _ := json.Marshal(payload)

r, err := crashReportFromDetail("performance", string(detail))
if err != nil { 
    log.Fatal(err) 
}
// r.Message now includes the native runtime context from appendNativeResourceContext
fmt.Println(r.Message)

```

The `crashReportFromDetail` function (lines 102-108) parses the JSON, recognizes the `"performance"` kind, and passes it through the reporting pipeline where `appendNativeResourceContext` automatically injects runtime metrics.

## Key Source Files for Performance Analysis

Understanding these files helps you extend or debug the performance reporting pipeline:

- **[`desktop/crash_app.go`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/desktop/crash_app.go)**: Core report handling. Contains `normalizeReportKind` for validation, `crashReportFromDetail` for parsing, `appendNativeResourceContext` for runtime enrichment (lines 85-90), and `postCrashReport` for remote submission (lines 44-54).
- **[`desktop/crash_app_test.go`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/desktop/crash_app_test.go)**: Demonstrates the performance-report flow with test payloads (lines 51-66) and verifies native context inclusion.
- **[`workers/crash-report/src/index.ts`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/workers/crash-report/src/index.ts)**: Server-side worker that receives reports and persists them for later analysis.
- **[`npm/reasonix/package.json`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/npm/reasonix/package.json)**: Defines the frontend package capable of sending performance payloads.

## Extending the Performance Pipeline

If you need to ship additional metrics (such as CPU usage or custom application-specific telemetry), you can extend the `frontendCrashPayload` struct with new fields (for example, `CustomMetrics map[string]string`). Modify `crashReportFromDetail` to copy these fields into the `crashReport` struct. The existing pipeline will still automatically append the native runtime context via `appendNativeResourceContext` without requiring changes to the enrichment logic.

## Summary

- **DeepSeek-Reasonix supports performance analysis** through a dedicated reporting pathway that treats performance events as first-class crash reports.
- **Automatic enrichment** occurs via `appendNativeResourceContext` in [`desktop/crash_app.go`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/desktop/crash_app.go), which injects Go runtime metrics (heap, sys memory, goroutines, GC cycles) into every performance report.
- **Unified pipeline** means performance data flows through the same endpoints (`https://crash.reasonix.io/v1/report`) as crash data, enabling consolidated storage and visualization.
- **Extensible architecture** allows you to add custom metrics to the `frontendCrashPayload` while retaining automatic native context injection.

## Frequently Asked Questions

### What runtime metrics does DeepSeek-Reasonix capture automatically?

DeepSeek-Reasonix captures Go runtime statistics including heap allocation size, heap system memory, total system memory, active goroutine count, and completed garbage collection cycles. These metrics are injected via the `appendNativeResourceContext` function in [`desktop/crash_app.go`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/desktop/crash_app.go) whenever the report kind is `"performance"`.

### How do I send a performance report from the frontend?

Send a POST request with a JSON payload containing `schemaVersion: 2`, `kind: "performance"`, and your custom metrics in the `message` field. The backend will automatically enrich the report with native runtime context before forwarding it to the central crash endpoint at `https://crash.reasonix.io/v1/report`.

### Can I add custom metrics to performance reports?

Yes. You can extend the `frontendCrashPayload` struct with additional fields (such as `CustomMetrics map[string]string`) and modify `crashReportFromDetail` in [`desktop/crash_app.go`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/desktop/crash_app.go) to copy these into the `crashReport`. The existing `appendNativeResourceContext` function will continue to append native runtime metrics automatically without requiring modifications.

### Where are performance reports stored after submission?

Performance reports are sent to the same endpoint as crash reports (`https://crash.reasonix.io/v1/report`) and are processed by the worker defined in [`workers/crash-report/src/index.ts`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/workers/crash-report/src/index.ts). This worker persists the reports for later querying and visualization, allowing you to analyze performance trends alongside application errors.