Skip to content

perf: pre-allocate strings in context building #316

@bug-ops

Description

@bug-ops

Context

Context building allocates intermediate strings per message via format/collect/join. Use String::with_capacity() + std::fmt::Write instead.

Apply to: compact_context, inject_semantic_recall, inject_summaries, inject_cross_session_context.

Affected crates

zeph-core

Ref

.local/plan/performance-audit.md — Issue 2.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    performancePerformance optimization

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions