Skip to content

perf: listTracesPaginated loads all traces into memory before slicing #667

@anandgupta42

Description

@anandgupta42

Found during v0.5.20 release review. Deferred because: requires embedding timestamps in filenames or a lightweight index — significant design work.

listTracesPaginated calls Trace.listTraces(dir) which reads and JSON-parses every trace file on disk, then slices the array. For users with thousands of traces, this is O(n) memory and CPU on every paginated request. The pagination API gives users the impression of efficiency while doing full-table-scan work underneath.

Flagged by: CTO, End User, Tech Lead, Chaos Gremlin (4/5 reviewers).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions