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: use slacc on check-word-mute #10721

Merged
merged 8 commits into from
May 5, 2023
Merged

perf: use slacc on check-word-mute #10721

merged 8 commits into from
May 5, 2023

Conversation

acid-chicken
Copy link
Member

@acid-chicken acid-chicken commented Apr 26, 2023

What

ワードミュート検知で単一の単語クエリに https://github.com/misskey-dev/slacc を使用して高速化する

Why

Close #10715

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

@github-actions github-actions bot added packages/backend Server side specific issue/PR packages/backend:test labels Apr 26, 2023
@codecov
Copy link

codecov bot commented Apr 26, 2023

Codecov Report

Merging #10721 (cd50bd6) into develop (14e364a) will increase coverage by 0.04%.
The diff coverage is 89.47%.

@@             Coverage Diff             @@
##           develop   #10721      +/-   ##
===========================================
+ Coverage    77.32%   77.36%   +0.04%     
===========================================
  Files          901      901              
  Lines        89672    89690      +18     
  Branches      6558     6583      +25     
===========================================
+ Hits         69339    69391      +52     
+ Misses       20333    20299      -34     
Impacted Files Coverage Δ
packages/backend/src/misc/check-word-mute.ts 92.30% <89.47%> (+45.49%) ⬆️

... and 1 file with indirect coverage changes

@acid-chicken

This comment was marked as resolved.

@acid-chicken acid-chicken changed the title perf: use slacc on check-word-mute when all of specified words are single word perf: use slacc on check-word-mute Apr 26, 2023
@acid-chicken

This comment was marked as resolved.

@acid-chicken acid-chicken marked this pull request as ready for review April 27, 2023 07:37
@github-actions github-actions bot requested a review from rinsuki April 27, 2023 07:37
.npmrc Outdated Show resolved Hide resolved
@acid-chicken acid-chicken marked this pull request as draft April 27, 2023 08:16
@acid-chicken acid-chicken marked this pull request as ready for review April 27, 2023 08:27
@tamaina

This comment was marked as duplicate.

@tamaina
Copy link
Contributor

tamaina commented Apr 29, 2023

slaccはモジュールごとにnpmからインストールするようにするのがいいかも

@tamaina
Copy link
Contributor

tamaina commented Apr 29, 2023

misskey-dev/slacc#2

@tamaina

This comment was marked as duplicate.

@acid-chicken

This comment was marked as resolved.

@syuilo
Copy link
Member

syuilo commented May 2, 2023

RustっぽいけどJSから呼び出す際のオーバーヘッドって無いのかな

@tamaina
Copy link
Contributor

tamaina commented May 2, 2023

swcも同様の仕組みだけどしゅいろ的にはオーバーヘッドがあるように見えている?

@acid-chicken
Copy link
Member Author

@acid-chicken
Copy link
Member Author

なんか何度か貼った気もするけどともかく Node.js 上で呼び出してベンチマークを取っている image

@tamaina

This comment was marked as off-topic.

@acid-chicken
Copy link
Member Author

何度か貼った気もする

全然見たことがない

#10715 (comment)

@acid-chicken
Copy link
Member Author

RustっぽいけどJSから呼び出す際のオーバーヘッドって無いのかな

@syuilo 純粋な呼び出しコストとしてはこんな感じ https://napi-rs.github.io/napi-rs/dev/bench/

@acid-chicken
Copy link
Member Author

書き忘れてたけどモジュールの件は解決したので ready for review です

@syuilo syuilo merged commit 4a72941 into develop May 5, 2023
@syuilo syuilo deleted the slacc branch May 5, 2023 10:49
@syuilo
Copy link
Member

syuilo commented May 5, 2023

👍🏻

sasagar pushed a commit to sasagar/misskey that referenced this pull request May 9, 2023
* perf: use slacc on check-word-mute when all of specified words are single word

* perf: use slacc as possible

* build: avoid tarball

* chore: update slacc

* build: update package name
na2na-p pushed a commit to na2na-p/misskey that referenced this pull request May 10, 2023
* perf: use slacc on check-word-mute when all of specified words are single word

* perf: use slacc as possible

* build: avoid tarball

* chore: update slacc

* build: update package name
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
None yet
Development

Successfully merging this pull request may close these issues.

ワードミュートなど String#includes をリストで回す処理のパフォーマンスを改善する
3 participants