Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

リアクションをポーリングで取得するオプション #11090

Open
syuilo opened this issue Jul 3, 2023 · 9 comments
Open

リアクションをポーリングで取得するオプション #11090

syuilo opened this issue Jul 3, 2023 · 9 comments
Assignees
Labels
packages/frontend Client side specific issue/PR 🐢Performance Efficiency related issue/PR

Comments

@syuilo
Copy link
Member

syuilo commented Jul 3, 2023

Summary

例えば1秒間に100個くらいリアクションが付く場合、ストリーミングで100個リアクション情報が流れてくるためとても無駄がある
ポーリングにすれば「どのリアクションがいくつか」という情報ひとつだけで済むためパフォーマンスが改善できそう

@syuilo syuilo added 🐢Performance Efficiency related issue/PR packages/frontend Client side specific issue/PR labels Jul 3, 2023
@syuilo syuilo changed the title リアクションをポーリングで取得する リアクションをポーリングで取得するオプション Jul 3, 2023
@mei23
Copy link
Contributor

mei23 commented Jul 3, 2023

1秒間に100個くらいリアクションが付く場合

そのついたリアクション数 x 連合インスタンス数 分のdeliverと他のサーバーのinbox処理が発生するのもどうにかしたいわ。

@syuilo syuilo self-assigned this Jul 4, 2023
@yuriha-chan
Copy link
Contributor

ちょっとわがままなお願いなのですが、ノートをタイムラインが流れながらもすごい勢いでいろいろなリアクションがついていくのを眺めるのが好きなので、ポーリングの間隔は最初が短めなのがだんだん長くなるとか、リアクションがリアルタイムでついているかのように差分の更新が再生されるなどの仕組みがあると嬉しいです。(新しい種類のリアクションがついたとき、そのリアクションが最初についた時刻もデータに含まれていて、それを考慮した表示にするとよりリアルな感じになるかも。)

あとポーリングというより、一定期間ためた情報を定期的にプッシュする方がパフォーマンス的に良いかも。

@syuilo
Copy link
Member Author

syuilo commented Jul 5, 2023

時刻情報を含めると、『「どのリアクションがいくつか」という情報ひとつだけで済む』が実現できず、「ストリーミングで100個リアクション情報が流れてくる」とデータ量的には変わらなくなりそうな気がしている

@yuriha-chan
Copy link
Contributor

ちょっと冗長に書きますが

{igyo: {firstReaction: 03:34:00.00, count: 24},
super_igyo: {firstReaction: 03:34:00.50, count: 9}
ultra_igyo: {firstReaction: 03:34:01.00, count: 2}}

というデータを03:34:02.00に受け取ると、3:34:02.00~34:34:04.00の間に秒速12で偉業スタンプが、3:34:02.50~34:34:04.00の間に秒速6でスーパー偉業スタンプが、3:34:03.00~34:34:04.00の間に秒速2でウルトラ偉業スタンプが、みたいなイメージです。あくまでリアリティを増すための一案で、実装してみたらいまいちかもしれませんが。

@syuilo
Copy link
Member Author

syuilo commented Jul 5, 2023

ほむん

@syuilo
Copy link
Member Author

syuilo commented Jul 5, 2023

フォロワー数が少ないユーザーの場合はリアクションが大量につくことは少ないだろうから、フォロワー数が一定以上のユーザーの投稿だけポーリングにするとか、そういうヒューリスティックは要るかも

@syuilo
Copy link
Member Author

syuilo commented Jul 6, 2023

あと設定のデータセーバーがオンの場合も強制ポーリングで良さそう

@syuilo
Copy link
Member Author

syuilo commented Jul 6, 2023

あーでもリアクションが付くことが少ないTLの場合ポーリングにするとむしろ通信量は増加する可能性があるな

@acid-chicken
Copy link
Member

あーでもリアクションが付くことが少ないTLの場合ポーリングにするとむしろ通信量は増加する可能性があるな

ポーリングじゃなくて WebSocket の送出側が debounce すべき

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages/frontend Client side specific issue/PR 🐢Performance Efficiency related issue/PR
Projects
Development

No branches or pull requests

4 participants