Skip to content

perf: optimize repetition detection for high-frequency streaming #55

Description

@terisuke

背景

GLM-5.1 thinking corruption fix(Issue #52)でrepetition detectionを実装。

問題

現在のdetectRepetition()はO(n*m)で���全てのtext-deltaイベントで呼ばれる。
高速ストリーミング時に性能影響の可能性がある。

対策案

  • N文字蓄積ごとにチェック(例:500文字ごと)
  • Rolling hashアルゴリズムの採用
  • キャッシュベースの最適化

現状

実測では1ms以下で完了するため、現時点ではブロッカーではない。
高速モデル(GPT-5.x等)での負荷テスト後に再評価。

関連

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