GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — perf: optimize repetition detection for high-frequency streaming · Issue #55 · Cor-Incorporated/opencode

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

New issue
Copy link
New issue
Copy link
Closed
Closed
perf: optimize repetition detection for high-frequency streaming#55
Copy link

Description

@terisuke
terisuke
opened on Apr 5, 2026
Issue body actions

背景

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

問題

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

対策案

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

現状

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

関連

  • Issue [Bug] GLM-5.1 thinking output corruption — repetition loop + tool call leak #52 (GLM-5.1 thinking corruption)
  • Upstream Issue: [BUG] GLM-5 model pollutes context window with broken thinking output anomalyco/opencode#16903

Activity

  1. terisuke commented on Apr 5, 2026

    @terisuke
    terisuke
    on Apr 5, 2026
    Author
    More actions

    進捗更新: detectRepetition は repetition.ts に抽出済み (PR #70)。ただしアルゴリズム自体は同一のネステッドスキャンのまま (repetition.ts:8)、processor.ts:162,373 で毎 delta 呼び出し。性能最適化は未着手。

  2. terisuke commented on Apr 6, 2026

    @terisuke
    terisuke
    on Apr 6, 2026
    Author
    More actions

    Note: upstream/dev has the repetition detection removal in preparation on feature branches (not yet merged to dev). When upstream merges, repetition.ts will be deleted. No optimization needed.

  3. terisuke commented on Apr 8, 2026

    @terisuke
    terisuke
    on Apr 8, 2026
    Author
    More actions

    Closing as won't-fix for now. Per the issue body itself:

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

    The repetition detection runs in sub-millisecond time. No measurable performance impact observed with current models (GPT-5.4, GLM-5.1, Claude Sonnet 4.5). If future high-speed models expose latency, reopen with profiling data.

  4. terisuke
    closed this as completedon Apr 8, 2026
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

      You are visitor 01402792 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.