Skip to content

Avoid repeated copying while assembling long Tool history turns #1012

Open

Description

@fengnanrui

Loading an older folded Tool turn can require up to 250 backend pages. The
current loadDirectHistoryTurn prepends every page by copying the entire
previous result, so assembling N rows across P pages takes O(N * P) reference
copies. A 5,000-row / 250-page turn copies 627,500 row references before it can
be displayed.

Keep the fetched pages until the turn boundary is known and flatten them once
in chronological order. Preserve the existing cursor, request-budget, and
all-or-error publication contracts.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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