Skip to content

[Metronome] Use binary encoding for BeatEvent instead of JSON #23

Description

@hakaru

概要

PeerMetronomeService.broadcastBeat において、BeatEvent の送信に JSONEncoder が使用されています。

詳細

指揮モードの Beat 送信はリアルタイムパスであり、Reflection ベースの JSON エンコードは CPU 負荷が高く、ペイロードサイズも大きくなります。
BeatEvent は sessionID (UUID), sequence (UInt32), beatIndex (UInt8), tickType (Enum), applyAtNs (UInt64) と固定的な構造を持っているため、バイナリ形式で直接 Data に書き込む方が効率的です。

期待される動作

Command のペイロードとして、バイナリ形式で BeatEvent をエンコード/デコードする。

優先度

Medium

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions