-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
refactor(backend): UserEntityService.packMany()の高速化 #13550
Merged
syuilo
merged 4 commits into
misskey-dev:develop
from
samunohito:refactor/13546-faster-user-entity-pack-many
Mar 12, 2024
Merged
refactor(backend): UserEntityService.packMany()の高速化 #13550
syuilo
merged 4 commits into
misskey-dev:develop
from
samunohito:refactor/13546-faster-user-entity-pack-many
Mar 12, 2024
+729
−36
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
packages/backend
Server side specific issue/PR
packages/backend:test
labels
Mar 9, 2024
このPRによるapi.jsonの差分 差分はこちら |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #13550 +/- ##
===========================================
- Coverage 66.09% 64.83% -1.26%
===========================================
Files 990 986 -4
Lines 115462 111005 -4457
Branches 5750 5736 -14
===========================================
- Hits 76311 71968 -4343
+ Misses 37715 37603 -112
+ Partials 1436 1434 -2 ☔ View full report in Codecov by Sentry. |
👍👍👍 |
mattyatea
added a commit
to prismisskey/prsmsk-fork
that referenced
this pull request
May 24, 2024
…dev#13550)" This reverts commit 5c1d86b.
1 task
mattyatea
added a commit
to Type4ny-Project/Type4ny
that referenced
this pull request
Jul 15, 2024
* localOnly * localOnly * ui fix * いろいろかえた * いろいろかえた * いろいろかえた * いろいろかえた * fix: expanded * fix: expanded * fix: expanded * fix: expanded * fix: expanded * emoji * ui:fix * ui:fix * ui:fix * 2024.2.0-beta.9-PrisMisskey.2 * ui:fix * ui:fix * ui:fix * ui:fix * 色々 * 色々 * 色々 * feat(backend): Federated note update (#1) (cherry picked from commit 6af23d4e28893b0ab253182153973bcad1210ac0) * fix * ノートの編集履歴を見れるように(新規ノートのみ) (cherry picked from commit 25763ee) * fix * update README.md * update README.md * update README.md * a * a * a * a * a * a * a * a * a * a * a * spec(backend/NoteCreateService): ローカルユーザーがまだ誰もフォローしていないリモートユーザーによる通知を引き起こす可能性のある投稿を拒否できるように (MisskeyIO#462) Cherry-picked from 738b4d6, 1b3adcc, 33cb507, a27af00, 5c6236b Co-authored-by: Ebise Lutica <7106976+EbiseLutica@users.noreply.github.com> * a * a * a * a * fix: channel timeline post form * fix: channel timeline post form * are * are * are * are * are * are * are * are * are * are * are * Revert "fix: 古いキャッシュを使うのを修正 (misskey-dev#13453)" This reverts commit 2c6f25b. * Revert "Revert "fix: 古いキャッシュを使うのを修正 (misskey-dev#13453)"" This reverts commit d64feb7. * Revert "refactor(backend): UserEntityService.packMany()の高速化 (misskey-dev#13550)" This reverts commit 5c1d86b. * enhance(backend): inbox queue error in update note (cherry picked from commit 1312c4f944b235d77275a51047275f84e4904de8) * aaa * aaa * aaa * aaa * aaa * aaa * aaa * aaa * aaa * aaa * aaa * outsideprismisskey * update * update * update * update * update * update * update * update * update * update * update * update * Revert "update" This reverts commit 55c80db. * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * add: 下書きに関する関数等の切り離し * feat: 下書きピッカーを実装 * refactor: indexedDbに移行 * change: uniqueIdの指定を必須に * fix: マイグレーションが正常に行えない問題を修正 * enhance: 下書きピッカーを改善 * feat: 投稿フォームに下書きを適用できるように * feat: 下書きを自動保存するかどうかを設定できるように * feat: 「下書きとして保存」ボタンを実装 * enhance: 既に入力されている内容がある場合に上書き警告を出すように * add: 翻訳を追加 * update * update * update * update * update * update * Update docker.yml * update * update * update * feat: メインタイムラインのタブをカスタマイズ可能に(misskey-dev#8759) * feat: リストをピン留めできるように * fix: console.log消し忘れ * Update CHANGELOG.md * fix: spdx-license-id * Update CHANGELOG.md * Fix: 命名規則など * Fix * 2024.5.0-mattyatea2 * emoji more * emoji more * 2024.5.0-mattyatea3 * fix * fix * fix * fix * fix * fix * 2024.5.0-mattyatea4 * Type4ny Project Initialize * fix(storybook): prevent infinite remount of component (misskey-dev#14101) * fix(storybook): prevent infinite remount of component * fix: disable flaky `.toMatch()` test * update deps (misskey-dev#14057) * wip * locales/index.jsのymlファイル取得ロジックを調節 * regenerate pnpm-lock.yaml * fix(backend): typecheck fails * chore(deps): bump ip-cidr from 4.0.0 to 4.0.1 in /packages/backend * chore: migrate ESLint configs to flat config (misskey-dev#14094) * chore: migrate ESLint configs to flat config * fix: update paths * fix: frontend lint fails * refactor(misskey-js): lint build.js * update deps --------- Co-authored-by: samunohito <46447427+samunohito@users.noreply.github.com> Co-authored-by: zyoshoka <root@zyoshoka.com> Co-authored-by: zyoshoka <107108195+zyoshoka@users.noreply.github.com> * test(backend): goodbye, Lenna (misskey-dev#14111) * Use built-in API (misskey-dev#14095) * dev: fix pnpm dev is broken (misskey-dev#14123) * dev: pnpm dev is broken * dev: fix crash pnpm dev because of unhandled promise * fix(storybook): build skipping even after updating impl story files (misskey-dev#14124) * refactor(frontend): refactor popup api and make sure call dispose callback Close misskey-dev#14122 * fix(dev): devサーバーで`/notes/`に直でアクセスしたらサーバー側のレスポンスが返ってくる問題を修正 (misskey-dev#14137) * fix import path * fix changelog * fix(backend): parse5関係の型のimport方法を変更 (misskey-dev#14146) * fix(frontend): サーバーサイドbootでエラー画面の描画時にDOMが初期化できていないことがあるのを修正 (misskey-dev#14139) * feat(misskey-js): multipart/form-dataのリクエストに対応 (misskey-dev#14147) * feat(misskey-js): multipart/form-dataのリクエストに対応 * lint * add test * Update Changelog * テストを厳しくする * lint * multipart/form-dataではnullのプロパティを弾くように * fix(backend): 名前を空白文字列だけにできる問題を修正 (misskey-dev#14119) * fix(backend): 名前を空白文字列だけにできる問題を修正 * Update Changelog * fix test * Unicodeを含める * fix * ユーザー名がUnicode制御文字とスペースのみで構成される場合はnullに * Revert "ユーザー名がUnicode制御文字とスペースのみで構成される場合はnullに" This reverts commit 6c752a6. * [ci skip] changelog typo * Fix compose file name (misskey-dev#14153) * Bump release actions to v2 (develop-stable(master) branches system) (misskey-dev#13941) * fix/refactor(frontend): hotkeyの改修 (misskey-dev#14157) * improve(frontend): hotkeyの改修 (misskey-dev#234) (cherry picked from commit 678be14) * Change path, add missing script Co-authored-by: taiy <53635909+taiyme@users.noreply.github.com> * fix * fix * add missing keycodes * fix * update changelog --------- Co-authored-by: taiy <53635909+taiyme@users.noreply.github.com> * fix(backend): api-docをScalarに変更 (misskey-dev#14152) * fix(backend): api-docをScalarに変更 * Update Changelog * fix(frontend): remove unused statement fix misskey-dev#14162 * feat(misskey-js): `POST admin/roles/create`の型を具象化 (misskey-dev#14167) * feat(misskey-js): `POST admin/roles/create`の型を具象化 * fix * docs: CHANGELOG.md * test(misskey-js): admin/roles/createの型が合うことを表明 * test(misskey-js): single quote * test(misskey-js): 無を読もうとして爆発するのを修正 * test(misskey-js): fix comment * Improve background color specification (misskey-dev#14176) * リリースPRがないときにrelease-edit-with-push.ymlがfailして見栄えが悪いのを修正 (misskey-dev#14160) * enhance(frontend): ウェルカムタイムラインのデザインを調整 (misskey-dev#14156) * enhance(frontend): 非ログイン時のハイライトTLのデザイン調整 * Update Changelog * fix cw handling * ホバーしてたらスクロールを止めるように * fix * lint * enhance(frontend): 未使用のサウンド設定を削除 (misskey-dev#14116) * enhance(frontend): 未使用のサウンド設定を削除 * Update Changelog * Update CHANGELOG.md * fix(frontend): フォーカスの挙動を修正 (misskey-dev#14158) * fix(frontend): 直前のパターンを記録するように * fix(frontend): フォーカス/タブ移動に関する挙動を調整 (misskey-dev#226) Cherry-pick commit e8c0306 Co-authored-by: taiyme <53635909+taiyme@users.noreply.github.com> * focusのデザイン修正 * move scripts * Modalにfocus trapを追加 * 記録するホットキーはレートリミット式にする * escキーのハンドリングをMkModalに統一 * fix * enterで子メニューを開けるように * lint * fix focus trap * improve switch accessibility * 一部のmodalのフォーカストラップが外れない問題を修正 * fix * fix * Revert "記録するホットキーはレートリミット式にする" This reverts commit 40a7509. * Revert "fix(frontend): 直前のパターンを記録するように" This reverts commit 5372b25. * Revert "Revert "fix(frontend): 直前のパターンを記録するように"" This reverts commit a9bb52e. * Revert "Revert "記録するホットキーはレートリミット式にする"" This reverts commit bdac342. * 試験的にCypressでのFocustrapを無効化 * fix * fix focus-trap * Update Changelog * ✌️ * fix focustrap invocation logic * スクロールがsticky headerを考慮するように * 🎨 * スタイルの微調整 * 🎨 * remove deprecated key aliases * focusElementが足りなかったので修正 * preview系にfocus時スタイルが足りなかったので修正 * `returnFocusElement` -> `returnFocusTo` * lint * Update packages/frontend/src/components/MkModalWindow.vue * Apply suggestions from code review Co-authored-by: taiy <53635909+taiyme@users.noreply.github.com> * keydownイベントをまとめる * use correct pesudo-element selector * fix * rename --------- Co-authored-by: taiyme <53635909+taiyme@users.noreply.github.com> Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com> * fix(frontend): use proper import path * fix: サジェストされるユーザのリストアップ方法を見直し (misskey-dev#14180) * fix: サジェストされるユーザのリストアップ方法を見直し * fix comment * fix CHANGELOG.md * ノートの無いユーザ(updatedAtが無いユーザ)は含めないらしい * fix test * fix(backend): デフォルトテーマに無効なテーマコードを入力するとUIが使用できなくなる問題を修正 Fix misskey-dev#13955 * fix(frontend): すでにfocus trap対象の要素にinertがかかっている場合は解除するように (misskey-dev#14189) * fix(frontend): すでにfocus trap対象の要素にinertがかかっている場合は解除するように * 他のfocus-trapped要素とのインタラクションがある場合の動作を変更 * typo * fix(frontend): ホットキーのレートリミットがallowRepeatを考慮しない問題を修正 (misskey-dev#14192) * refactor(sw): enable noImplicitAny (misskey-dev#14191) * parse `notRespondingSince` from redis instance cache (misskey-dev#14079) if we don't do this, we'll get a string, and `DeliverProcessorService` will error out `i.notRespondingSince.getTime is not a function` * deps(frontend): AiScript VSCodeのバージョンを上げる (misskey-dev#14199) * fix(backend): 一般ユーザーから見たユーザーのバッジの一覧に公開されていないものが含まれることがある問題を修正 (misskey-dev#14195) * enhance(backend): 公開バッジのみをpackするように (MisskeyIO#652) (cherry picked from commit b8a9065) * Update Changelog * fix * Update UserEntityService.ts --------- Co-authored-by: CyberRex <26585194+CyberRex0@users.noreply.github.com> * Feat: ユーザーのアイコン/バナーの変更可否をロールで設定可能に (misskey-dev#14078) * feat: implement role policy "canUpdateBioMedia" * docs(changelog): update changelog * docs(changelog): update changelog * chore: regenerate misskey-js type definitions * chore: Apply suggestion from code review Co-authored-by: anatawa12 <anatawa12@icloud.com> * chore: fix unnecessarily strict inequality check * chore: policies should be gotten only once --------- Co-authored-by: anatawa12 <anatawa12@icloud.com> * test(backend): kill many `any` in backend test (partial) (misskey-dev#14054) * kill any on utils:api * kill any on timeline test * use optional chain to kill TS2532 on timeline test 変更前: 該当ノートが見つからなければundefinedに対するプロパティアクセスとしてテストがクラッシュ 変更後: 該当ノートが見つからなければoptional chainがundefinedとして評価されるが、strictEqualの右辺がnon-nullableなためアサーションに失敗しテストがクラッシュ * kill `as any` for ApMfmService * kill argument any for api-visibility * kill argument any across a few tests * do not return value that has yielded from `await`-ing `Promise<void>` * force cast * runtime non-null assertion to coerce * rewrite `assert.notEqual(expr, null)` to `assert.ok(expr)` こうすることでassertion type扱いになり、non-nullableになる * change return type of `failedApiCall` to `void` 戻り値がどこにも使われていない * split bindings for exports.ts 型が合わなくて文句を言ってくるので適切に分割 * runtime non-null assertion * runtime non-null assertion * 何故かうまく行かないので、とりあえずXORしてみる * Revert "何故かうまく行かないので、とりあえずXORしてみる" This reverts commit 48cf32c. * castAsErrorで安全ではないキャストを隠蔽 * 型アサーションの追加 * 型アサーションの追加 * 型アサーションの追加 * voidで値を返さない * castAsError * assert.ok => kill nullability * もはや明示的な型の指定は必要ない * castAsError * castAsError * 型アサーションの追加 * nullableを一旦抑止 * 変数を分離して型エラーを排除 * 不要なプロパティを削除する処理を隠蔽してanyを排除 * Repository type * simple type * assert.ok => kill nullability * revert `as any` drop reverts fe95c05 partialy * test: fix invalid assertion partially revert b99b7b5 * test: 52d8a54 により型が合うようになった部分の`as any`を除去 * format * test: apply misskey-dev#14054 (comment) (part 1) * test: use non-null assertion to suppress too many error * Update packages/backend/test/utils.ts Co-authored-by: anatawa12 <anatawa12@icloud.com> --------- Co-authored-by: anatawa12 <anatawa12@icloud.com> * enhance(frontend): サーバー情報・お問い合わせページを改修 (misskey-dev#14198) * improve(frontend): サーバー情報・お問い合わせページを改修 (misskey-dev#238) * Revert "Revert "enhance(frontend): add contact page" (misskey-dev#208)" (This reverts commit 5a329a0.) * improve(frontend): サーバー情報・お問い合わせページを改修 (cherry picked from commit e72758d) * fix * Update Changelog * tweak * lint * 既存の翻訳を使用するように --------- Co-authored-by: taiy <53635909+taiyme@users.noreply.github.com> * enhance: 非ログイン時には別サーバーに遷移できるように (misskey-dev#13089) * enhance: 非ログイン時にはMisskey Hub経由で別サーバーに遷移できるように * fix * サーバーサイド照会を削除 * クライアント側の照会動作 * hubを経由せずにリモートで続行できるように * fix と pleaseLogin誘導箇所の追加 * fix * fix * Update CHANGELOG.md --------- Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com> * refactor(misskey-js): enable exactOptionalPropertyTypes (misskey-dev#14203) * refactor(misskey-js): enable exactOptionalPropertyTypes * refactor(misskey-js): fix error where is appeared by enabling * fix(frontend): Nested RouteのときにRouterViewに当たるキーがルートのpathとぶち当たる可能性があるのを修正 (misskey-dev#14202) Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com> * ci: ワークフローが更新されたときにもワークフローが起動するようにする (misskey-dev#14207) * ci: include themselves in `on.push.paths` command: find .github/workflows -type f \( -name '*.yaml' -or -name '*.yml' \) | xargs -I {} yq_4.44.2-linux_x86-64 'select(.on.push.paths != null) | .[0] | map("{}")[0]' {} | xargs -I {} ~/.local/bin/yq_4.44.2-linux_x86-64 -i '.on.push.paths += ["{}"]' {} * ci: include themselves in `on.pull_request.paths` command: find .github/workflows -type f \( -name '*.yaml' -or -name '*.yml' \) | xargs -I {} yq_4.44.2-linux_x86-64 'select(.on.pull_request.paths != null) | .[0] | map("{}")[0]' {} | xargs -I {} ~/.local/bin/yq_4.44.2-linux_x86-64 -i '.on.pull_request.paths += ["{}"]' {} * fix(frontend): follow-up of misskey-dev#13089 (misskey-dev#14206) * fix(frontend): misskey-dev#13089 を修正 * fix * 正規表現を強化 * fix * enhance(backend): configにsignToActivityPubGetの指定が無い場合trueと見做すように trueの方が望ましいため * fix(backend): ユーザーのリアクション一覧でミュート/ブロックが機能していなかった問題を修正 (misskey-dev#14100) * fix: mute/block was not considered on users/reactions * docs(changelog): update changelog * chore: Apply suggestion from code review Co-authored-by: zyoshoka <107108195+zyoshoka@users.noreply.github.com> --------- Co-authored-by: zyoshoka <107108195+zyoshoka@users.noreply.github.com> * fix: error with trying to handle SIGKILL (misskey-dev#14208) * chore(deps): bump actions/setup-node from 4.0.2 to 4.0.3 (misskey-dev#14165) Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4.0.2 to 4.0.3. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](actions/setup-node@v4.0.2...v4.0.3) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * ci: cache eslint (misskey-dev#14204) * ci: cache eslint * dummy commit to trigger * fix syntax error * Enhance(frontend): Allow negative delay in MFM (misskey-dev#14200) Co-authored-by: easrng <me@easrng.net> * enhance(backend): Load settings via environment variables (misskey-dev#14179) * feat(backend): Load settings via environment variables If they're not loaded from the config file. * chore(docker): Add hints for environment variables It supports users to know about them. * docs(changelog): Add the description about this change Users can notice what's changed by this PR. * style(backend): Fix code syntax To pass the linter. * chore(backend): registed -> registered (misskey-dev#14213) * chore(backend): registed -> registered * Update CHANGELOG.md * mattyatea Fork とマージ * Fix: マージミス --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Caipira <caipira@libnare.net> Co-authored-by: GrapeApple0 <84321396+grapeapple0@users.noreply.github.com> Co-authored-by: NoriDev <m1nthing2322@gmail.com> Co-authored-by: まっちゃとーにゅ <17376330+u1-liquid@users.noreply.github.com> Co-authored-by: Ebise Lutica <7106976+EbiseLutica@users.noreply.github.com> Co-authored-by: yukineko <27853966+hideki0403@users.noreply.github.com> Co-authored-by: zyoshoka <107108195+zyoshoka@users.noreply.github.com> Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com> Co-authored-by: samunohito <46447427+samunohito@users.noreply.github.com> Co-authored-by: zyoshoka <root@zyoshoka.com> Co-authored-by: Kisaragi <48310258+KisaragiEffective@users.noreply.github.com> Co-authored-by: woxtu <woxtup@gmail.com> Co-authored-by: anatawa12 <anatawa12@icloud.com> Co-authored-by: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> Co-authored-by: tamaina <tamaina@hotmail.co.jp> Co-authored-by: taiy <53635909+taiyme@users.noreply.github.com> Co-authored-by: Gianni Ceccarelli <dakkar@thenautilus.net> Co-authored-by: CyberRex <26585194+CyberRex0@users.noreply.github.com> Co-authored-by: Sayamame-beans <61457993+Sayamame-beans@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: easrng <easrng@gmail.com> Co-authored-by: easrng <me@easrng.net> Co-authored-by: Souma <101255979+5ouma@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix #13546
What
UserEntityServcie.packMany()
の高速化を図りました。pack時にDBから1件ずつ取得していた関連テーブルのレコード群をあらかじめまとめて取得してMap化し、以降はそのMapから関連レコードを取り寄せるようにしました。
Why
fix #13546
Additional info (optional)
APIConsoleから/api/admin/show-usersに対し、limit: 100のみ設定してリクエストした時の所要時間で測定(ユーザ数は100件以上ある)
改善前:7.39sec ※メモリやRedisによるキャッシュが効く2回目以降は5.88sec前後
改善後:1.88sec ※メモリやRedisによるキャッシュが効く2回目以降は0.49sec前後
Checklist