sonicop 26.8.112-aarch64-linux → 26.8.113-aarch64-linux
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.ja.md +36 -23
- data/README.md +38 -26
- data/lib/sonicop/version.rb +1 -1
- data/libexec/sonicop +0 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 136e1c379d405c4db2d9cb1bc865f06215d927887cf2291b87b235b0a1df5432
|
|
4
|
+
data.tar.gz: d9002980b9a8866e0092531b12089d37cc59f2d06de440614130809029051fb0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 79b863cb8c6ca365e1174e68f3fc9021deef4c1219cb06d21d5195e6fbf77c65899171720efb951db0a2989268826d536f80ec0de2b52e6efe0a01d8ac0395c5
|
|
7
|
+
data.tar.gz: 63fc02ecf63eb567f4be8d692791d1c6fa4be6e190faad0f4ea5cd4fea823be57d4649090759b83c63b6aa7f6506639dbdc4ccdc65d4be02a6f137a06bb3e1e4
|
data/README.ja.md
CHANGED
|
@@ -153,6 +153,8 @@ sonicop --show-cops
|
|
|
153
153
|
`AllCops/DisabledByDefault`、`Include`/`Exclude`、Cop ごとの `Enabled`、`Exclude`、
|
|
154
154
|
`Severity`、`Safe`、`SafeAutoCorrect` と設定値に対応します。宣言されたプラグイン由来の
|
|
155
155
|
Cop は「認識済み・未実装」として受理し、Ruby プラグインコード自体は実行しません。
|
|
156
|
+
リモート設定のリクエストには 30 秒のネットワークタイムアウトを設け、応答は 1 件あたり
|
|
157
|
+
5 MiB に制限します。
|
|
156
158
|
|
|
157
159
|
```yaml
|
|
158
160
|
inherit_from: .rubocop_todo.yml
|
|
@@ -229,52 +231,63 @@ autocorrect は RuboCop 自身のツリーと Mastodon でバイト単位に一
|
|
|
229
231
|
既定の実行はどちらの群にも届きません。)
|
|
230
232
|
各値は暖機後 2 回の最速値です。
|
|
231
233
|
|
|
232
|
-
| コーパス | ファイル | RuboCop 並列 | Sonicop 並列 | RuboCop 単一 | Sonicop 単一 |
|
|
233
|
-
|
|
234
|
-
| rubocop/rubocop | 1,
|
|
235
|
-
| mastodon/mastodon | 3,
|
|
236
|
-
| Homebrew/brew | 2,
|
|
237
|
-
| rails/rails | 3,
|
|
238
|
-
| ruby/ruby | 7,
|
|
234
|
+
| コーパス | ファイル | offense | RuboCop 並列 | Sonicop 並列 | RuboCop 単一 | Sonicop 単一 |
|
|
235
|
+
|---|---:|---:|---:|---:|---:|---:|
|
|
236
|
+
| rubocop/rubocop | 1,780 | 5,826 | 10.85 秒 | **1.53 秒** | 41.44 秒 | **8.96 秒** |
|
|
237
|
+
| mastodon/mastodon | 3,292 | 15,293 | 22.59 秒 | **3.04 秒** | 34.74 秒 | **6.86 秒** |
|
|
238
|
+
| Homebrew/brew | 2,296 | 51,527 | 13.56 秒 | **2.21 秒** | 40.36 秒 | **6.51 秒** |
|
|
239
|
+
| rails/rails | 3,562 | 168,615 | 32.90 秒 | **8.84 秒** | 85.71 秒 | **19.17 秒** |
|
|
240
|
+
| ruby/ruby | 7,477 | 765,975 | 86.89 秒 | **15.59 秒** | 193.59 秒 | **37.98 秒** |
|
|
239
241
|
|
|
240
|
-
差は並列で
|
|
242
|
+
差は並列で 3.7〜7.4 倍、単一プロセスで 4.5〜6.2 倍と幅があり、1 コーパスでは代表できません。
|
|
241
243
|
**単一プロセスの列を読み、並列は目安として扱ってください。** 同じ 2 つのバイナリを 1 日に
|
|
242
244
|
3 回測ったところ、単一プロセスの値は毎回 16% 以内に収まったのに対し、RuboCop 自身のツリーでの
|
|
243
245
|
並列の倍率は、マシンが他に何をしていたかだけで 3.3 倍から 9.2 倍まで動きました。単一プロセスは
|
|
244
246
|
エンジンを測っていますが、並列はエンジンに加えて「その実行でスケジューリングがそのツリーに
|
|
245
247
|
どれだけ噛み合ったか」を測っています。
|
|
246
248
|
|
|
247
|
-
仕事を省いて速いわけではありません。この同じ 394 Cop
|
|
248
|
-
|
|
249
|
-
|
|
249
|
+
仕事を省いて速いわけではありません。この同じ 394 Cop について、表のどのコーパスでも
|
|
250
|
+
**offense の総数が一致**し、RuboCop 自身のツリーと Mastodon ではその 1 件ずつが同じ位置・
|
|
251
|
+
同じメッセージ・同じ severity です。Rails は 168,615 件のうち 2 件だけ食い違います
|
|
252
|
+
(Sonicop が出す `Style/CaseLikeIf` 1 件と、出さない `Metrics/AbcSize` 1 件)。
|
|
253
|
+
RuboCop 自身のツリーでは 1 件の `correctable` フラグが違います。
|
|
254
|
+
autocorrect は前者と後者でバイト単位に一致します。
|
|
250
255
|
|
|
251
|
-
再現時に注意が必要な点が
|
|
256
|
+
再現時に注意が必要な点が 4 つあります。RuboCop は **`--cache false` と併用すると
|
|
252
257
|
`--parallel` を黙って無効化します**。そのためここでの並列実行はキャッシュを有効にしたうえで
|
|
253
258
|
実行ごとにキャッシュディレクトリを消しており、`--cache false --parallel` で計測すると
|
|
254
259
|
単一プロセスを測ることになり差が過大に出ます。また RuboCop の既定は単一プロセス、
|
|
255
260
|
Sonicop は `--no-parallel` を渡さない限り並列です。そして**両方ともキャッシュを空にする**
|
|
256
261
|
必要があります。Sonicop も既定でキャッシュするため、同じツリーを 2 回目に流すと自分の
|
|
257
262
|
キャッシュが答えてしまい、エンジンについては何も測れません。どちらにも使い捨ての
|
|
258
|
-
|
|
263
|
+
キャッシュディレクトリを渡してください。最後に、そのキャッシュディレクトリは**実パス**である
|
|
264
|
+
必要があります。macOS の `mktemp -d` は `/var/folders/…` を返し、その `/var` は symlink なので
|
|
265
|
+
RuboCop はそこを拒み、キャッシュ無しで走ってしまいます。
|
|
259
266
|
|
|
260
267
|
```bash
|
|
261
268
|
# RuboCop(並列・キャッシュは毎回空・既定の全 394 Cop)
|
|
262
|
-
|
|
269
|
+
root=$(mktemp -d /private/tmp/bench.XXXXXX)
|
|
270
|
+
rubocop --force-default-config --cache true --cache-root "$root" \
|
|
263
271
|
--no-color --parallel -f quiet
|
|
264
272
|
|
|
265
273
|
# Sonicop(キャッシュは毎回空)
|
|
266
|
-
sonicop --force-default-config --cache-root "$
|
|
274
|
+
sonicop --force-default-config --cache-root "$root" --format quiet
|
|
267
275
|
```
|
|
268
276
|
|
|
277
|
+
キャッシュの書き込みもこの数値に含まれており、無料ではありません。索引は全 offense を
|
|
278
|
+
「見つかった行のテキスト」付きで保持するため、`ruby/ruby` では 336 MB になります。
|
|
279
|
+
2 回目の実行(キャッシュ命中)は `ruby/ruby` で 1.59 秒、Rails で 0.42 秒です。
|
|
280
|
+
|
|
269
281
|
測定機は Apple M2(8 コア)、Ruby 4.0.6(YJIT 利用可)、RubyGems 導入の RuboCop 1.89.0。
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
282
|
+
2026-08-31 に、`rubocop_rubocop` 2693129 / `mastodon_mastodon` b59ddc7 / `Homebrew_brew` b42173b /
|
|
283
|
+
`rails_rails` a19f07f / `ruby_ruby` 22e4a75 の各リビジョンに対して測定しました。
|
|
284
|
+
1 分平均のロードアベレージは各行の測定時点で 4.5〜7.1 で、その大半は RuboCop 自身の並列
|
|
285
|
+
ワーカーです(計測する以上避けられません)。**アイドル状態ではありません。**
|
|
286
|
+
各コーパスで両者を連続して同じ条件で測っているため倍率は保たれますが、秒数そのものは下限ではなく、
|
|
287
|
+
静かなマシンならより速く出ます。コアを奪い合うものが動いていると両者とも膨らみ、その度合いは
|
|
288
|
+
一致しません。それが並列の列があれだけ動く理由です。秒数そのものが重要なときは、他に負荷のない
|
|
289
|
+
状態で測り、**実行の前後でロードアベレージを記録してください** — その情報が無い数値は、
|
|
290
|
+
別の数値と比べられません。
|
|
278
291
|
|
|
279
292
|
## 開発
|
|
280
293
|
|
data/README.md
CHANGED
|
@@ -160,6 +160,8 @@ run. Local and HTTPS `inherit_from`, `inherit_gem`, `inherit_mode`,
|
|
|
160
160
|
`AllCops/DisabledByDefault`, `Include`, and `Exclude`, plus per-cop `Enabled`, `Exclude`,
|
|
161
161
|
`Severity`, `Safe`, `SafeAutoCorrect`, and cop settings are supported. Cops supplied by declared
|
|
162
162
|
plugins are accepted as recognized-but-unimplemented without executing Ruby plugin code.
|
|
163
|
+
Remote configuration requests use 30-second network timeouts, and each response is limited to
|
|
164
|
+
5 MiB.
|
|
163
165
|
|
|
164
166
|
```yaml
|
|
165
167
|
inherit_from: .rubocop_todo.yml
|
|
@@ -240,52 +242,62 @@ once the 159 RuboCop ships as `Enabled: pending` and the 56 it ships as `Enabled
|
|
|
240
242
|
aside; a default run reaches neither group on either side.) Times are the fastest of two
|
|
241
243
|
warmed runs.
|
|
242
244
|
|
|
243
|
-
| Corpus | Files | RuboCop parallel | Sonicop parallel | RuboCop single | Sonicop single |
|
|
244
|
-
|
|
245
|
-
| rubocop/rubocop | 1,
|
|
246
|
-
| mastodon/mastodon | 3,
|
|
247
|
-
| Homebrew/brew | 2,
|
|
248
|
-
| rails/rails | 3,
|
|
249
|
-
| ruby/ruby | 7,
|
|
245
|
+
| Corpus | Files | Offenses | RuboCop parallel | Sonicop parallel | RuboCop single | Sonicop single |
|
|
246
|
+
|---|---:|---:|---:|---:|---:|---:|
|
|
247
|
+
| rubocop/rubocop | 1,780 | 5,826 | 10.85 s | **1.53 s** | 41.44 s | **8.96 s** |
|
|
248
|
+
| mastodon/mastodon | 3,292 | 15,293 | 22.59 s | **3.04 s** | 34.74 s | **6.86 s** |
|
|
249
|
+
| Homebrew/brew | 2,296 | 51,527 | 13.56 s | **2.21 s** | 40.36 s | **6.51 s** |
|
|
250
|
+
| rails/rails | 3,562 | 168,615 | 32.90 s | **8.84 s** | 85.71 s | **19.17 s** |
|
|
251
|
+
| ruby/ruby | 7,477 | 765,975 | 86.89 s | **15.59 s** | 193.59 s | **37.98 s** |
|
|
250
252
|
|
|
251
|
-
The gap is
|
|
253
|
+
The gap is 3.7x to 7.4x in parallel and 4.5x to 6.2x single-process, so no single corpus summarizes
|
|
252
254
|
it. **Read the single-process column and treat the parallel one as indicative.** Measuring the same
|
|
253
255
|
two binaries three times over a day put the single-process figures within 16% of each other every
|
|
254
256
|
time, while the parallel ratio on RuboCop's own tree moved between 3.3x and 9.2x purely with what
|
|
255
257
|
else the machine was doing. Single-process measures the engines; parallel measures the engines plus
|
|
256
258
|
how well each one's scheduling happens to fit that tree on that run.
|
|
257
259
|
|
|
258
|
-
The speed is not bought by skipping work
|
|
259
|
-
on
|
|
260
|
-
|
|
260
|
+
The speed is not bought by skipping work. Over those same 394 cops the two find the **same number of
|
|
261
|
+
offenses** on every corpus in the table, and on RuboCop's own tree and on Mastodon every one of them
|
|
262
|
+
is at the same position with the same message and severity. Rails, at 168,615 offenses, differs in
|
|
263
|
+
two of them — one `Style/CaseLikeIf` Sonicop reports and one `Metrics/AbcSize` it does not — and
|
|
264
|
+
RuboCop's own tree differs in one offense's `correctable` flag. Autocorrect is byte-identical on the
|
|
265
|
+
first and the last.
|
|
261
266
|
|
|
262
|
-
|
|
267
|
+
Four details matter for reproducing this. RuboCop **silently turns `--parallel` off when combined
|
|
263
268
|
with `--cache false`**, so its parallel runs here use a cache directory that is deleted before each
|
|
264
269
|
run rather than disabled; timing it with `--cache false --parallel` measures a single process and
|
|
265
270
|
overstates the difference. RuboCop's default is a single process, while Sonicop is parallel unless
|
|
266
|
-
`--no-parallel` is passed.
|
|
267
|
-
second run over the same tree answers from its own cache and measures nothing about the engine
|
|
268
|
-
|
|
271
|
+
`--no-parallel` is passed. Both sides need a **cold** cache: Sonicop caches by default too, so a
|
|
272
|
+
second run over the same tree answers from its own cache and measures nothing about the engine —
|
|
273
|
+
give each tool a throwaway cache root. And the cache root must be a **real path**: macOS `mktemp -d`
|
|
274
|
+
returns `/var/folders/…`, whose `/var` is a symlink, and RuboCop refuses such a location and runs
|
|
275
|
+
with no cache at all.
|
|
269
276
|
|
|
270
277
|
```bash
|
|
271
278
|
# RuboCop, parallel, cold cache, its full default set of 394 cops
|
|
272
|
-
|
|
279
|
+
root=$(mktemp -d /private/tmp/bench.XXXXXX)
|
|
280
|
+
rubocop --force-default-config --cache true --cache-root "$root" \
|
|
273
281
|
--no-color --parallel -f quiet
|
|
274
282
|
|
|
275
283
|
# Sonicop, cold cache
|
|
276
|
-
sonicop --force-default-config --cache-root "$
|
|
284
|
+
sonicop --force-default-config --cache-root "$root" --format quiet
|
|
277
285
|
```
|
|
278
286
|
|
|
287
|
+
Writing the cache is part of these numbers, and it is not free: the index holds every offense with
|
|
288
|
+
the source line it was found on, which is 336 MB over `ruby/ruby`. A second run against a warm cache
|
|
289
|
+
answers in 1.59 s there, and in 0.42 s over Rails.
|
|
290
|
+
|
|
279
291
|
Machine: Apple M2 (8 cores), Ruby 4.0.6 with YJIT available, RubyGems-installed RuboCop 1.89.0.
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
292
|
+
Measured on 2026-08-31 against the corpora at `rubocop_rubocop` 2693129, `mastodon_mastodon` b59ddc7,
|
|
293
|
+
`Homebrew_brew` b42173b, `rails_rails` a19f07f and `ruby_ruby` 22e4a75. The one-minute load average
|
|
294
|
+
was between 4.5 and 7.1 as each row was taken — most of it RuboCop's own parallel workers, which is
|
|
295
|
+
inherent to measuring them. **The machine was in use, not idle.** Both tools ran back to back under
|
|
296
|
+
the same conditions on each corpus, so the ratios hold, but the absolute seconds are not a floor:
|
|
297
|
+
expect better on a quiet machine. Anything competing for cores inflates both sides, and not by the
|
|
298
|
+
same factor on each, which is what makes the parallel column move as much as it does. If the
|
|
299
|
+
absolute numbers matter to you, measure on an idle machine and record the load either side of the
|
|
300
|
+
run — a figure without that context cannot be compared with another one.
|
|
289
301
|
|
|
290
302
|
## Development
|
|
291
303
|
|
data/lib/sonicop/version.rb
CHANGED
data/libexec/sonicop
CHANGED
|
Binary file
|