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

perf(backend): JSON.parse の呼び出しを削減する #11091

Merged
merged 2 commits into from
Jul 3, 2023

Conversation

riku6460
Copy link
Contributor

@riku6460 riku6460 commented Jul 3, 2023

What

Redis から拾ったデータの JSON.parse の呼び出しを削減しました。

Why

Misskey.io のバックエンドをプロファイリングしたところ、JSON.parse が WebSocket のコネクション数だけ呼ばれていたため

Additional info (optional)

Tested on misskey.io

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

@github-actions github-actions bot added the packages/backend Server side specific issue/PR label Jul 3, 2023
@codecov
Copy link

codecov bot commented Jul 3, 2023

Codecov Report

Merging #11091 (bd8754f) into develop (84d3a06) will decrease coverage by 0.13%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           develop   #11091      +/-   ##
===========================================
- Coverage    77.33%   77.21%   -0.13%     
===========================================
  Files          907      737     -170     
  Lines        91480    70142   -21338     
  Branches      7546     7052     -494     
===========================================
- Hits         70748    54158   -16590     
+ Misses       20732    15984    -4748     
Impacted Files Coverage Δ
...ackend/src/server/api/StreamingApiServerService.ts 88.33% <100.00%> (+0.40%) ⬆️

... and 171 files with indirect coverage changes

@syuilo syuilo merged commit 61e7eb8 into misskey-dev:develop Jul 3, 2023
@syuilo
Copy link
Member

syuilo commented Jul 3, 2023

👍🏻👍🏻

@riku6460 riku6460 deleted the reduce-json-parse-calls branch July 4, 2023 02:41
@tamaina
Copy link
Contributor

tamaina commented Jul 4, 2023

CPU使用率が100%に張り付く時間が半減した感じがする

slofp pushed a commit to Secineralyr/misskey.dream that referenced this pull request Jul 21, 2023
* perf(backend): JSON.parse の呼び出しを削減する

Co-authored-by: Hidekazu Kobayashi <[email protected]>

* Update CHANGELOG.md

---------

Co-authored-by: Hidekazu Kobayashi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages/backend Server side specific issue/PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants