Skip to content

perf(backend): ブロック・サイレンス状態をInstanceテーブルに含める#16123

Draft
kakkokari-gtyih wants to merge 25 commits intomisskey-dev:developfrom
kakkokari-gtyih:pref-include-block-info-in-instance-table
Draft

perf(backend): ブロック・サイレンス状態をInstanceテーブルに含める#16123
kakkokari-gtyih wants to merge 25 commits intomisskey-dev:developfrom
kakkokari-gtyih:pref-include-block-info-in-instance-table

Conversation

@kakkokari-gtyih
Copy link
Copy Markdown
Contributor

What

This change persists the state of meta.blockedHosts, meta.silencedHosts, meta.mediaSilencedHost, and meta.federationInstances to the matching row in instance. This allows for simple joins instead of slow WHERE NOT ILIKE ALL() constructions. With change to enforce instance blocks in queries, this is essential for reasonable performance. In testing, some query time was reduced from ~2.5 seconds to ~0.5 seconds. Other queries should see a smaller, but still substantial gain.

https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1068

Why

Additional info (optional)

テスト中(とりあえず引っ張ってきてみただけ)

Checklist

  • Read the contribution guide
  • Test working in a local environment
  • (If needed) Add story of storybook
  • (If needed) Update CHANGELOG.md
  • (If possible) Add tests

warriordog and others added 24 commits May 31, 2025 00:51
@kakkokari-gtyih kakkokari-gtyih changed the title perf(backend): [WIP] perf(backend): ブロック・サイレンス状態をInstanceテーブルに含める May 30, 2025
@github-actions github-actions Bot added packages/backend Server side specific issue/PR packages/backend:test labels May 30, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 30, 2025

このPRによるapi.jsonの差分
差分はありません。
Get diff files from Workflow Page

@codecov
Copy link
Copy Markdown

codecov Bot commented May 30, 2025

Codecov Report

❌ Patch coverage is 71.74888% with 126 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.12%. Comparing base (9f196bb) to head (2fff98f).
⚠️ Report is 1075 commits behind head on develop.

Files with missing lines Patch % Lines
packages/backend/src/core/MetaService.ts 33.73% 55 Missing ⚠️
packages/backend/src/core/QueryService.ts 4.16% 23 Missing ⚠️
...kages/backend/src/core/FederatedInstanceService.ts 75.43% 14 Missing ⚠️
...ckages/backend/src/core/chart/charts/federation.ts 0.00% 11 Missing ⚠️
.../backend/src/core/FanoutTimelineEndpointService.ts 0.00% 7 Missing ⚠️
...ackend/src/server/api/endpoints/users/reactions.ts 0.00% 6 Missing ⚠️
packages/backend/src/misc/diff-arrays.ts 95.09% 5 Missing ⚠️
...backend/src/core/entities/InstanceEntityService.ts 0.00% 3 Missing ⚠️
packages/backend/src/core/ReversiService.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #16123      +/-   ##
===========================================
- Coverage    46.20%   45.12%   -1.08%     
===========================================
  Files         1710     1711       +1     
  Lines       174828   175142     +314     
  Branches      5324     5072     -252     
===========================================
- Hits         80777    79038    -1739     
- Misses       93564    95616    +2052     
- Partials       487      488       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

packages/backend:test packages/backend Server side specific issue/PR

Projects

Development

Successfully merging this pull request may close these issues.

2 participants