reclaimable 0.1.0
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 +7 -0
- data/.claude/launch.json +11 -0
- data/.gitignore +11 -0
- data/.gitlab-ci.yml +16 -0
- data/AGENTS.md +88 -0
- data/CLAUDE.md +1 -0
- data/Gemfile +3 -0
- data/LICENSE +674 -0
- data/README.md +160 -0
- data/Rakefile +28 -0
- data/ai-skill/reclaimable/SKILL.md +94 -0
- data/benchmark/README.md +59 -0
- data/benchmark/experiments/lstat_scanner.rb +11 -0
- data/benchmark/experiments/ractor_scanner.rb +92 -0
- data/benchmark/experiments/verify_bulk_list.rb +34 -0
- data/benchmark/lib/fixture.rb +104 -0
- data/benchmark/lib/results.rb +62 -0
- data/benchmark/reports/00-baseline.md +75 -0
- data/benchmark/reports/01-jit.md +70 -0
- data/benchmark/reports/02-ractor.md +58 -0
- data/benchmark/reports/03-getattrlistbulk.md +84 -0
- data/benchmark/reports/04-others.md +52 -0
- data/benchmark/reports/05-outside-root.md +56 -0
- data/benchmark/reports/06-round2-discussion.md +374 -0
- data/benchmark/reports/06-round2.md +194 -0
- data/benchmark/reports/README.md +46 -0
- data/benchmark/results/baseline.yml +126 -0
- data/benchmark/results/bulk-list.yml +126 -0
- data/benchmark/results/final-yjit.yml +126 -0
- data/benchmark/results/final.yml +126 -0
- data/benchmark/results/ractor-exp.yml +38 -0
- data/benchmark/results/round2-after.yml +126 -0
- data/benchmark/results/round2-before.yml +126 -0
- data/benchmark/results/src-baseline.yml +32 -0
- data/benchmark/results/src-bulk-list.yml +32 -0
- data/benchmark/results/src-pair-none1.yml +38 -0
- data/benchmark/results/src-pair-none2.yml +38 -0
- data/benchmark/results/src-pair-yjit1.yml +38 -0
- data/benchmark/results/src-pair-yjit2.yml +38 -0
- data/benchmark/results/src-ractor-exp.yml +32 -0
- data/benchmark/results/src-round2-after1.yml +52 -0
- data/benchmark/results/src-round2-after2.yml +52 -0
- data/benchmark/results/src-round2-before1.yml +52 -0
- data/benchmark/results/src-round2-before2.yml +52 -0
- data/benchmark/results/yjit.yml +126 -0
- data/benchmark/results/zjit.yml +126 -0
- data/benchmark/run.rb +149 -0
- data/bin/reclaimable +10 -0
- data/doc/performance.md +179 -0
- data/lib/reclaimable/ai_skill.rb +138 -0
- data/lib/reclaimable/bulk_list.rb +91 -0
- data/lib/reclaimable/cache_dump.rb +125 -0
- data/lib/reclaimable/cli.rb +168 -0
- data/lib/reclaimable/cloud_files.rb +33 -0
- data/lib/reclaimable/config.rb +100 -0
- data/lib/reclaimable/i18n.rb +24 -0
- data/lib/reclaimable/locations.rb +89 -0
- data/lib/reclaimable/output.rb +154 -0
- data/lib/reclaimable/paths.rb +36 -0
- data/lib/reclaimable/report.rb +504 -0
- data/lib/reclaimable/ruby_abi.rb +69 -0
- data/lib/reclaimable/scan_cache.rb +97 -0
- data/lib/reclaimable/scanner.rb +440 -0
- data/lib/reclaimable/util.rb +34 -0
- data/lib/reclaimable.rb +42 -0
- data/locale/ja/LC_MESSAGES/reclaimable.mo +0 -0
- data/man/reclaimable.1.ronn +302 -0
- data/man/reclaimable.en.1 +234 -0
- data/man/reclaimable.ja.1 +452 -0
- data/po/ja/reclaimable-docs.po +668 -0
- data/po/ja/reclaimable.po +510 -0
- data/rakelib/benchmark.rake +22 -0
- data/rakelib/docs/japanese.rb +132 -0
- data/rakelib/docs/man_page.rb +73 -0
- data/rakelib/docs/site.rb +187 -0
- data/rakelib/docs/sources.rb +94 -0
- data/rakelib/docs/translation.rb +157 -0
- data/rakelib/docs.rake +62 -0
- data/rakelib/gettext.rake +30 -0
- data/rakelib/i18n.rake +199 -0
- data/reclaimable.gemspec +56 -0
- data/site/index.md +142 -0
- data/site/layout.html.erb +60 -0
- data/site/style.css +82 -0
- metadata +231 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
---
|
|
2
|
+
label: zjit
|
|
3
|
+
measured_at: '2026-11-16 05:49:12'
|
|
4
|
+
ruby: ruby 4.0.9 (2026-10-23 revision 3e93b23afc) +ZJIT +PRISM [arm64-darwin27]
|
|
5
|
+
jit: zjit
|
|
6
|
+
scanner: Reclaimable::Scanner
|
|
7
|
+
root: "/Users/kitaitimakoto/src/gitlab.com/KitaitiMakoto/reclaimable/tmp/benchmark/fixture"
|
|
8
|
+
jobs: 8
|
|
9
|
+
reps: 5
|
|
10
|
+
dirs: 30321
|
|
11
|
+
total_bytes: 887324672
|
|
12
|
+
scenarios:
|
|
13
|
+
scan (no cache):
|
|
14
|
+
real:
|
|
15
|
+
- 2.4291
|
|
16
|
+
- 2.5125
|
|
17
|
+
- 2.5096
|
|
18
|
+
- 2.433
|
|
19
|
+
- 2.385
|
|
20
|
+
user:
|
|
21
|
+
- 1.0916
|
|
22
|
+
- 1.1067
|
|
23
|
+
- 1.1185
|
|
24
|
+
- 1.0794
|
|
25
|
+
- 1.0613
|
|
26
|
+
sys:
|
|
27
|
+
- 4.4791
|
|
28
|
+
- 4.7023
|
|
29
|
+
- 4.659
|
|
30
|
+
- 4.512
|
|
31
|
+
- 4.4628
|
|
32
|
+
scan (cached):
|
|
33
|
+
real:
|
|
34
|
+
- 0.2408
|
|
35
|
+
- 0.2422
|
|
36
|
+
- 0.2431
|
|
37
|
+
- 0.2402
|
|
38
|
+
- 0.2433
|
|
39
|
+
user:
|
|
40
|
+
- 0.1601
|
|
41
|
+
- 0.1611
|
|
42
|
+
- 0.1611
|
|
43
|
+
- 0.1594
|
|
44
|
+
- 0.1615
|
|
45
|
+
sys:
|
|
46
|
+
- 0.146
|
|
47
|
+
- 0.1466
|
|
48
|
+
- 0.1491
|
|
49
|
+
- 0.1464
|
|
50
|
+
- 0.148
|
|
51
|
+
cache save:
|
|
52
|
+
real:
|
|
53
|
+
- 0.0701
|
|
54
|
+
- 0.0748
|
|
55
|
+
- 0.0773
|
|
56
|
+
- 0.0753
|
|
57
|
+
- 0.0765
|
|
58
|
+
user:
|
|
59
|
+
- 0.0681
|
|
60
|
+
- 0.0723
|
|
61
|
+
- 0.0754
|
|
62
|
+
- 0.0741
|
|
63
|
+
- 0.0752
|
|
64
|
+
sys:
|
|
65
|
+
- 0.002
|
|
66
|
+
- 0.0013
|
|
67
|
+
- 0.0014
|
|
68
|
+
- 0.0012
|
|
69
|
+
- 0.0012
|
|
70
|
+
cache load:
|
|
71
|
+
real:
|
|
72
|
+
- 0.0382
|
|
73
|
+
- 0.0303
|
|
74
|
+
- 0.0302
|
|
75
|
+
- 0.0304
|
|
76
|
+
- 0.0299
|
|
77
|
+
user:
|
|
78
|
+
- 0.0373
|
|
79
|
+
- 0.0299
|
|
80
|
+
- 0.0299
|
|
81
|
+
- 0.0301
|
|
82
|
+
- 0.0296
|
|
83
|
+
sys:
|
|
84
|
+
- 0.0009
|
|
85
|
+
- 0.0004
|
|
86
|
+
- 0.0003
|
|
87
|
+
- 0.0003
|
|
88
|
+
- 0.0003
|
|
89
|
+
cache dump (json):
|
|
90
|
+
real:
|
|
91
|
+
- 0.106
|
|
92
|
+
- 0.1029
|
|
93
|
+
- 0.1007
|
|
94
|
+
- 0.1
|
|
95
|
+
- 0.1015
|
|
96
|
+
user:
|
|
97
|
+
- 0.1012
|
|
98
|
+
- 0.0996
|
|
99
|
+
- 0.0989
|
|
100
|
+
- 0.0985
|
|
101
|
+
- 0.1
|
|
102
|
+
sys:
|
|
103
|
+
- 0.0048
|
|
104
|
+
- 0.0034
|
|
105
|
+
- 0.0017
|
|
106
|
+
- 0.0015
|
|
107
|
+
- 0.0015
|
|
108
|
+
startup (--help):
|
|
109
|
+
real:
|
|
110
|
+
- 0.2133
|
|
111
|
+
- 0.1524
|
|
112
|
+
- 0.1511
|
|
113
|
+
- 0.1497
|
|
114
|
+
- 0.1533
|
|
115
|
+
user:
|
|
116
|
+
- 0.1182
|
|
117
|
+
- 0.1146
|
|
118
|
+
- 0.1141
|
|
119
|
+
- 0.1133
|
|
120
|
+
- 0.1155
|
|
121
|
+
sys:
|
|
122
|
+
- 0.053
|
|
123
|
+
- 0.0344
|
|
124
|
+
- 0.0336
|
|
125
|
+
- 0.0333
|
|
126
|
+
- 0.0344
|
data/benchmark/run.rb
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# reclaimable のベンチマーク。使い方は benchmark/README.md を参照。
|
|
2
|
+
#
|
|
3
|
+
# bundle exec rake "benchmark[ラベル]" # フィクスチャー(作り物のツリー)で測る
|
|
4
|
+
# BENCH_ROOT=~/src bundle exec rake "benchmark[ラベル]" # 実際のフォルダーで測る
|
|
5
|
+
#
|
|
6
|
+
# 時間のかかる処理ごとにシナリオを分けて、benchmark ライブラリーで繰り返し測る。
|
|
7
|
+
# scan (no cache) キャッシュ無しの走査(初回や --fresh)
|
|
8
|
+
# scan (cached) 前回の走査結果を使う走査(2 回目以降。ふだんはこれ)
|
|
9
|
+
# cache save/load 走査結果のキャッシュの書き込み・読み込み(Marshal + gzip)
|
|
10
|
+
# cache dump (json) --dump-cache json
|
|
11
|
+
# startup (--help) 起動してすぐ終わるまで(ライブラリーの読み込み時間)
|
|
12
|
+
# どれも何も削除せず、利用者のキャッシュ(~/Library/Caches/reclaimable)も書き換えない。
|
|
13
|
+
|
|
14
|
+
Encoding.default_external = Encoding::UTF_8
|
|
15
|
+
|
|
16
|
+
require "benchmark"
|
|
17
|
+
require "etc"
|
|
18
|
+
require "tmpdir"
|
|
19
|
+
require "rbconfig"
|
|
20
|
+
|
|
21
|
+
$LOAD_PATH.unshift(File.expand_path("../lib", __dir__))
|
|
22
|
+
require "reclaimable"
|
|
23
|
+
require_relative "lib/fixture"
|
|
24
|
+
require_relative "lib/results"
|
|
25
|
+
|
|
26
|
+
module ReclaimableBenchmark
|
|
27
|
+
PROJECT = File.expand_path("..", __dir__)
|
|
28
|
+
WORK = File.join(PROJECT, "tmp/benchmark")
|
|
29
|
+
|
|
30
|
+
class Runner
|
|
31
|
+
def initialize(label)
|
|
32
|
+
@label = label
|
|
33
|
+
@reps = Integer(ENV.fetch("BENCH_REPS", "5"))
|
|
34
|
+
@jobs = Integer(ENV.fetch("BENCH_JOBS", [Etc.nprocessors, 8].min.to_s))
|
|
35
|
+
@only = ENV["BENCH_ONLY"]&.then { Regexp.new(it) }
|
|
36
|
+
# 試作の走査(benchmark/experiments/ のもの)に差し替えて測るための口
|
|
37
|
+
require File.expand_path(ENV["BENCH_REQUIRE"]) if ENV["BENCH_REQUIRE"]
|
|
38
|
+
@scanner_class = Object.const_get(ENV.fetch("BENCH_SCANNER", "Reclaimable::Scanner"))
|
|
39
|
+
prepare_root
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def run
|
|
43
|
+
# 最初の 1 回は OS のファイルキャッシュを温めるためのもので、測らない(ディスクの読み込み待ちを
|
|
44
|
+
# 測りたいのではなく、プログラムの側の速さを比べたいため)。この結果を「前回の走査結果」としても使う
|
|
45
|
+
warn "準備の走査をしています: #{@root}"
|
|
46
|
+
scanner = new_scanner(nil)
|
|
47
|
+
@total = scanner.scan
|
|
48
|
+
@dirs = scanner.dirs
|
|
49
|
+
# 走査は渡された木をその場で書き換えるが、中身が変わっていなければ木も変わらないので、繰り返し使える
|
|
50
|
+
@tree = scanner.tree
|
|
51
|
+
scanner = nil
|
|
52
|
+
|
|
53
|
+
Dir.mktmpdir("cache", WORK) do |dir|
|
|
54
|
+
@cache = Reclaimable::ScanCache.new(dir, @root, large: LARGE, output: Reclaimable::Output.new)
|
|
55
|
+
@cache.load(false)
|
|
56
|
+
@cache.save(@tree, @dirs)
|
|
57
|
+
@cache_path = Reclaimable::ScanCache.path_for(dir, @root)
|
|
58
|
+
measure_all
|
|
59
|
+
end
|
|
60
|
+
path = Results.save(@label, result)
|
|
61
|
+
warn "保存しました: #{path}"
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
private
|
|
65
|
+
|
|
66
|
+
BIG = 100 * Reclaimable::MB
|
|
67
|
+
LARGE = 10 * Reclaimable::MB
|
|
68
|
+
|
|
69
|
+
def prepare_root
|
|
70
|
+
if (root = ENV["BENCH_ROOT"])
|
|
71
|
+
@root = File.expand_path(root)
|
|
72
|
+
# 実際のフォルダーを測るときは、本体と同じく、クラウド上にしか無いファイルをダウンロードさせない
|
|
73
|
+
why = Reclaimable::CloudFiles.stop_downloads
|
|
74
|
+
@skip = why ? Reclaimable::CloudFiles::DIRS : []
|
|
75
|
+
warn "クラウド上のファイルのダウンロードを止められないので #{@skip.join(', ')} は走査しません(#{why})" if why
|
|
76
|
+
output = Reclaimable::Output.new
|
|
77
|
+
@watched = Set[*Reclaimable::Locations.known(output).map(&:first), *Reclaimable::Locations.container_dirs,
|
|
78
|
+
*Reclaimable::Locations.gem_dirs]
|
|
79
|
+
else
|
|
80
|
+
fixture = Fixture.new(File.join(WORK, "fixture"), dirs: Integer(ENV.fetch("BENCH_DIRS", "30000"))).ensure!
|
|
81
|
+
@root = fixture.root
|
|
82
|
+
@skip = []
|
|
83
|
+
@watched = Set[File.join(@root, "group01"), File.join(@root, "group02/project002")]
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Report#scan と同じ設定で走査する
|
|
88
|
+
def new_scanner(old_tree)
|
|
89
|
+
@scanner_class.new(@root, watched: @watched, big_threshold: BIG, large: LARGE, record_depth: 3,
|
|
90
|
+
no_artifacts_in: [File.join(Reclaimable::HOME, "Library"), Reclaimable::TRASH],
|
|
91
|
+
old_tree:, jobs: @jobs, skip: @skip)
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
def scenarios
|
|
95
|
+
{
|
|
96
|
+
"scan (no cache)" => -> { new_scanner(nil).scan },
|
|
97
|
+
"scan (cached)" => -> { new_scanner(@tree).scan },
|
|
98
|
+
"cache save" => -> { @cache.save(@tree, @dirs) },
|
|
99
|
+
"cache load" => -> { @cache.load(false) },
|
|
100
|
+
"cache dump (json)" => lambda {
|
|
101
|
+
File.open(File::NULL, "w") { Reclaimable::CacheDump.new(@cache_path, root: @root).write("json", it) }
|
|
102
|
+
},
|
|
103
|
+
# JIT の指定(RUBYOPT)は子プロセスにも引き継がれる
|
|
104
|
+
"startup (--help)" => lambda {
|
|
105
|
+
system(RbConfig.ruby, "-I#{File.join(PROJECT, 'lib')}", File.join(PROJECT, "bin/reclaimable"), "--help",
|
|
106
|
+
out: File::NULL, exception: true)
|
|
107
|
+
},
|
|
108
|
+
}.select { |name, _| @only.nil? || name.match?(@only) }
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
def measure_all
|
|
112
|
+
@times = {}
|
|
113
|
+
width = scenarios.keys.map(&:size).max
|
|
114
|
+
puts "#{' ' * width}#{Benchmark::CAPTION}"
|
|
115
|
+
scenarios.each do |name, job|
|
|
116
|
+
tms = Array.new(@reps) do
|
|
117
|
+
GC.start
|
|
118
|
+
Benchmark.measure(&job).tap { puts name.ljust(width) + it.format(Benchmark::FORMAT) }
|
|
119
|
+
end
|
|
120
|
+
# 子プロセス(startup)の CPU 時間も含めて記録する
|
|
121
|
+
@times[name] = { "real" => tms.map { it.real.round(4) },
|
|
122
|
+
"user" => tms.map { (it.utime + it.cutime).round(4) },
|
|
123
|
+
"sys" => tms.map { (it.stime + it.cstime).round(4) } }
|
|
124
|
+
end
|
|
125
|
+
puts
|
|
126
|
+
puts format("%-#{width}s %10s %10s %10s %10s", "", "real 最小", "real 中央", "user 最小", "sys 最小")
|
|
127
|
+
@times.each do |name, t|
|
|
128
|
+
puts format("%-#{width}s %10.3f %10.3f %10.3f %10.3f", name, Results.min(t["real"]), Results.median(t["real"]),
|
|
129
|
+
Results.min(t["user"]), Results.min(t["sys"]))
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
def jit
|
|
134
|
+
return "yjit" if defined?(RubyVM::YJIT) && RubyVM::YJIT.enabled?
|
|
135
|
+
return "zjit" if defined?(RubyVM::ZJIT) && RubyVM::ZJIT.enabled?
|
|
136
|
+
|
|
137
|
+
"none"
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
def result
|
|
141
|
+
{ "label" => @label, "measured_at" => Time.now.strftime("%F %T"), "ruby" => RUBY_DESCRIPTION, "jit" => jit,
|
|
142
|
+
"scanner" => @scanner_class.name, "root" => @root, "jobs" => @jobs, "reps" => @reps, "dirs" => @dirs,
|
|
143
|
+
"total_bytes" => @total, "scenarios" => @times }
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
FileUtils.mkdir_p(ReclaimableBenchmark::WORK)
|
|
149
|
+
ReclaimableBenchmark::Runner.new(ARGV.fetch(0, "latest")).run
|
data/bin/reclaimable
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
# macOS のファイル名は常に UTF-8。LANG の無い環境(nohup・launchd など)では Ruby がパスを
|
|
5
|
+
# BINARY として読み、日本語のパスを含む文字列の連結で落ちるので、ライブラリーを読む前に UTF-8 に固定する
|
|
6
|
+
Encoding.default_external = Encoding::UTF_8 unless Encoding.default_external == Encoding::UTF_8
|
|
7
|
+
|
|
8
|
+
require "reclaimable"
|
|
9
|
+
|
|
10
|
+
Reclaimable::CLI.new.run(ARGV)
|
data/doc/performance.md
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
# 速さについての判断の記録
|
|
2
|
+
|
|
3
|
+
高速化のために試した施策と、採用したか・しなかったかの記録。同じことを調べ直さずに済むよう、理由と数字を残す。
|
|
4
|
+
速さに手を入れる前に、まずここを読む。
|
|
5
|
+
|
|
6
|
+
- 測り方とベンチマークの使い方: [benchmark/README.md](../benchmark/README.md)
|
|
7
|
+
- 施策ごとのくわしいリポート: [benchmark/reports/](../benchmark/reports/README.md)
|
|
8
|
+
|
|
9
|
+
ここにある判断は、下の「計測した環境」でのもの。環境が変われば結果も変わりうるので、
|
|
10
|
+
各施策の「見直すとき」に当てはまったら、ベンチマークを測り直してから判断する。
|
|
11
|
+
|
|
12
|
+
## 計測した環境
|
|
13
|
+
|
|
14
|
+
2026-11-16 に計測。施策は 2 回に分けて入れた(一巡目: リポート 00〜05、二巡目: リポート 06)。
|
|
15
|
+
|
|
16
|
+
| 項目 | 値 |
|
|
17
|
+
| --- | --- |
|
|
18
|
+
| 機械 | Apple M2(高性能コア 4 + 高効率コア 4)、メモリー 24GB |
|
|
19
|
+
| OS | macOS 27.2.1(Darwin 27.2.0) |
|
|
20
|
+
| ストレージ | 内蔵 SSD、APFS |
|
|
21
|
+
| Ruby | 4.0.9(+PRISM)。YJIT・ZJIT 入りのビルド |
|
|
22
|
+
| gem | fiddle 1.1.8、benchmark 0.5.0 |
|
|
23
|
+
| スレッド数 | 8(`-j` の既定。CPU の数、最大 8) |
|
|
24
|
+
| 対象 1 | フィクスチャー: 作り物のツリー(3 万フォルダー、22 万ファイル)。全部が OS のファイルキャッシュに乗り、CPU 時間だけが出る |
|
|
25
|
+
| 対象 2 | `~/src`: 実際のフォルダー(62 万フォルダー、実占有 287GB)。待ち時間が大半 |
|
|
26
|
+
| OS のファイルキャッシュ | 温まった状態(測る前に 1 回走査する)。再起動直後のような空の状態は測っていない |
|
|
27
|
+
|
|
28
|
+
時間は秒で、各シナリオを繰り返したうちの `real` の最小値。`~/src` の値は、測る時間帯によって 1〜2 割ばらつく。
|
|
29
|
+
|
|
30
|
+
## 前提になる事実
|
|
31
|
+
|
|
32
|
+
施策の採否は、どれも次の 2 つから決まっている。
|
|
33
|
+
|
|
34
|
+
1. **時間の大半は走査で、その大半はカーネルの中(`lstat`)。** 施策を入れる前のキャッシュ無しの走査では、
|
|
35
|
+
CPU 時間の 8 割がシステムコールの中だった。Ruby のコードを速くしても、縮められるのは残りの 2 割まで。
|
|
36
|
+
2. **実際のフォルダーでは、待ち時間が大半。** `~/src` を 1 スレッドで走査すると、`real` 110 秒に対して CPU 時間は 61 秒。
|
|
37
|
+
60 万フォルダーぶんのメタデータは OS のキャッシュに収まりきらず、読み直しが起きる。
|
|
38
|
+
そのため、CPU の並列度を上げる施策(Ractor など)は、フィクスチャーで効いても実際のフォルダーでは効きにくい。
|
|
39
|
+
|
|
40
|
+
## 採用した施策
|
|
41
|
+
|
|
42
|
+
| 施策 | 効果 | 実装 | リポート |
|
|
43
|
+
| --- | --- | --- | --- |
|
|
44
|
+
| フォルダーの直下を `getattrlistbulk` でまとめて読む | キャッシュ無しの走査が約半分(`~/src` 43.0 → 22.3、フィクスチャー 2.37 → 1.03)。キャッシュありの走査はほぼ変わらない | `lib/reclaimable/bulk_list.rb`、`Scanner#read_dir` | [03](../benchmark/reports/03-getattrlistbulk.md) |
|
|
45
|
+
| 走査の前に YJIT を有効にする | 走査で 6〜15%(`~/src` で 5〜9%、フィクスチャーで 13%) | `CLI#enable_jit` | [01](../benchmark/reports/01-jit.md) |
|
|
46
|
+
| キャッシュの書き込みで、圧縮の速さを優先する(`Zlib::BEST_SPEED`) | 書き込みが 35% 速い(`~/src` で 2.33 → 1.51)。実行全体では 2〜3%。ファイルは 16% 大きくなる | `ScanCache#save` | [04](../benchmark/reports/04-others.md) |
|
|
47
|
+
| 起点の外の場所を、まとめて測ってキャッシュする | `-d` で起点を絞ったときの 2 回目以降が 31 → 21。1 回目は 2 秒遅くなる | `Report#measure_outside` | [05](../benchmark/reports/05-outside-root.md) |
|
|
48
|
+
| 外部コマンド(`brew`・`docker`・Ruby の版の問い合わせなど)を、走査の前に裏で始める | `-d` で起点を絞った実行が 20〜21 → 9。走査と重なる実行では、直列で約 20 秒だったものが約 11 秒 | `Output#prefetch`、`Report#prefetch` | [06](../benchmark/reports/06-round2.md) |
|
|
49
|
+
| キャッシュを木の形にし、小さいハードリンクの inode を覚える(形式の版 2) | `~/src` で、キャッシュありの走査 7.4 → 5.7、読み込み 1.8 → 0.5、書き込み 1.5 → 0.7。ホームのキャッシュのメモリーが 4 割に | `Scanner`、`ScanCache` | [06](../benchmark/reports/06-round2.md) |
|
|
50
|
+
| スレッドでサブツリーを並列に走査する(前からある) | `~/src` で 1 スレッドの 2.6〜4.6 倍速い。フィクスチャーでは 1 スレッドのほうが速いが、実際の使い方は `~/src` の側 | `Scanner` | [00](../benchmark/reports/00-baseline.md) |
|
|
51
|
+
|
|
52
|
+
### 見直すとき
|
|
53
|
+
|
|
54
|
+
- **`getattrlistbulk`**: macOS 以外で動かすようにするとき(今は `lstat` での読み方に戻るだけで、速くはならない)。
|
|
55
|
+
Linux なら `statx` や `getdents64` が相当するが、試していない。
|
|
56
|
+
- **YJIT**: ZJIT が YJIT より速くなったとき(下の「ZJIT」を参照)。
|
|
57
|
+
- **圧縮**: 効果は小さい。キャッシュのファイルの大きさが問題になったら、既定の圧縮率に戻してよい(ほかの施策には影響しない)。
|
|
58
|
+
- **スレッド数**: 下の「スレッド数を増やす」を参照。
|
|
59
|
+
- **外部コマンドの先読み**: 特になし。外部コマンドを足すときは、`Report#prefetch` にも足す(足さなくても動くが、その節で待つことになる)。
|
|
60
|
+
- **キャッシュの形式**: ノードに項目を足すときは `ScanCache::FORMAT_VERSION` を上げる。前の版のキャッシュは使われず、
|
|
61
|
+
最初の 1 回だけ全部走査し直す。
|
|
62
|
+
|
|
63
|
+
### 知っておくこと(挙動)
|
|
64
|
+
|
|
65
|
+
採用した施策にともなう挙動と、前からある挙動。くわしくは [06](../benchmark/reports/06-round2.md)。
|
|
66
|
+
|
|
67
|
+
- **キャッシュは 7 日に 1 回、全部走査し直す。** 「最後に全部走査した時刻」をキャッシュの中に持って判定する
|
|
68
|
+
(二巡目より前は、ファイルの更新時刻で見ていたため、週に 1 回以上動かしている限り期限が来なかった)。
|
|
69
|
+
- **その場の書き換えは、全部走査し直すまで見逃す。** フォルダーの mtime が変わらない限り、小さいファイルと
|
|
70
|
+
小さいハードリンク(10MB 未満)は前回の値を使う。大きいファイルは毎回 `lstat` する。
|
|
71
|
+
- **ハードリンクのフォルダーごとの帰属は、実行ごとに揺れる。** 同じ inode のバイト数は、最初に出会ったスレッドが
|
|
72
|
+
たどっていたフォルダーに付く。合計は変わらない。走査の結果を前後で突き合わせるときは、合計は 8 スレッドで、
|
|
73
|
+
フォルダーごとの数字は 1 スレッド(`-j 1`)で比べる。
|
|
74
|
+
- **普通のファイルに後からハードリンクを足すと、全部走査し直すまで二重に数える。**
|
|
75
|
+
- **キャッシュの読み込みが、まれに `Zlib::BufError` で失敗したことがある**(1 回。全部走査し直すだけで、結果は正しい)。
|
|
76
|
+
原因は特定できていない。読み書きをファイル全体で一度に行う形に変えてからは出ていない。
|
|
77
|
+
|
|
78
|
+
## 採用しなかった施策
|
|
79
|
+
|
|
80
|
+
### Ractor で並列に走査する
|
|
81
|
+
|
|
82
|
+
- **試したこと**: スレッドの代わりに Ractor でサブツリーをたどる試作(`benchmark/experiments/ractor_scanner.rb`)。
|
|
83
|
+
- **結果**: フィクスチャーでは速い(キャッシュ無し 2.37 → 1.19、キャッシュあり 0.246 → 0.067)。
|
|
84
|
+
`~/src` では、キャッシュ無しが 43.0 → 31.7、キャッシュありは 7.96 → 8.46 で速くならない。
|
|
85
|
+
- **採用しない理由**:
|
|
86
|
+
1. `getattrlistbulk` と併用できない。Fiddle は、メイン以外の Ractor から呼ぶと `Ractor::UnsafeError` になる。
|
|
87
|
+
どちらかを選ぶなら、`~/src` では `getattrlistbulk` のほうがどのシナリオでも速い。
|
|
88
|
+
2. ハードリンクの重複を、Ractor をまたいで除けない。試作では `~/src` の合計が 174MB 多く出た。
|
|
89
|
+
3. 手の空いたワーカーへ、たどっている途中の子フォルダーを渡せない(今のスレッド版はできる)。
|
|
90
|
+
4. Ruby 4.0 でも実験的で、使うたびに警告が出る。
|
|
91
|
+
- **見直すとき**: Fiddle が Ractor の中で使えるようになったとき。または、走査の対象が小さく、全部が OS のキャッシュに乗る
|
|
92
|
+
使い方が主になったとき。見直すときも、2 と 3 は解く必要がある。
|
|
93
|
+
- リポート: [02](../benchmark/reports/02-ractor.md)
|
|
94
|
+
|
|
95
|
+
### ZJIT
|
|
96
|
+
|
|
97
|
+
- **結果**: どのシナリオでも JIT なしとほぼ同じ(フィクスチャーのキャッシュ無しの走査 2.37 → 2.39、キャッシュあり 0.246 → 0.240)。
|
|
98
|
+
同じ条件で YJIT は 2.27 と 0.197。
|
|
99
|
+
- **見直すとき**: Ruby の版が上がったとき。`JIT=zjit bundle exec rake "benchmark[zjit]"` で測れる。
|
|
100
|
+
- リポート: [01](../benchmark/reports/01-jit.md)
|
|
101
|
+
|
|
102
|
+
### スレッド数を増やす
|
|
103
|
+
|
|
104
|
+
- **結果**: `~/src` で、8 → 16 → 32 と増やすと遅くなる(キャッシュ無し 22.3 → 24.0 → 28.8、キャッシュあり 7.10 → 8.78 → 8.78)。
|
|
105
|
+
システムコールの中の時間の合計が増えており、カーネルの中での取り合いが増えるだけだった。
|
|
106
|
+
- **見直すとき**: コアの数が違う機械、内蔵 SSD でないストレージ(ネットワーク越し・ハードディスクなど、待ち時間の性質が違うもの)。
|
|
107
|
+
`BENCH_JOBS` で測れる。
|
|
108
|
+
- リポート: [04](../benchmark/reports/04-others.md)
|
|
109
|
+
|
|
110
|
+
### 子フォルダーの `lstat` を、親のまとめ読みに替える
|
|
111
|
+
|
|
112
|
+
- **ねらい**: キャッシュありの走査で残っているシステムコールは、子フォルダーの更新時刻を確かめる `lstat`
|
|
113
|
+
(フォルダー 1 つにつき 1 回)がほぼ全部。これを、親を `getattrlistbulk` で 1 回読んで置き換える。
|
|
114
|
+
- **結果**: `~/src` のキャッシュを使って 1 スレッドで試すと、`lstat` のままが 25.0 秒、親を全部まとめ読みすると 39.7 秒。
|
|
115
|
+
まとめ読みはファイルも全部読むことになり、子フォルダーが 1 つか 2 つの親(全体の 8 割)では損をする。
|
|
116
|
+
子フォルダーが 3 つ以上の親に絞っても 22.5 秒(残りの `lstat` を含まない)で、差は小さい。
|
|
117
|
+
- **見直すとき**: 特になし。フォルダーの形(子フォルダーの数の分布)が大きく違う対象で使うなら、測り直す価値はある。
|
|
118
|
+
- リポート: [03](../benchmark/reports/03-getattrlistbulk.md)
|
|
119
|
+
|
|
120
|
+
### 走査の Ruby 側を細かく軽くする
|
|
121
|
+
|
|
122
|
+
- **試したこと**: `st.mtime` を 1 回にする、配列の作り直しをやめる、ビルド成果物の判定で名前を先に見る、など。
|
|
123
|
+
- **結果**: フィクスチャーでは 0.209 → 0.147 秒。`~/src` では real が縮まない(元 8.08・8.31 秒、軽い版 10.28・8.20 秒)。
|
|
124
|
+
user は 4.1 → 3.0〜3.3 秒に減っているが、待ち時間に埋もれる。
|
|
125
|
+
- **見直すとき**: 特になし。キャッシュを木の形にしたときに、同じ種類の無駄はほぼ無くなった。
|
|
126
|
+
- リポート: [06](../benchmark/reports/06-round2.md)
|
|
127
|
+
|
|
128
|
+
### キャッシュの読み込みの間、GC を止める
|
|
129
|
+
|
|
130
|
+
- **結果**: 平らな形式では 1.59 → 1.03 秒。木の形では得が 0.2 秒(1.11 → 0.87〜0.91 秒、ホームのキャッシュ)に減り、メモリーが 115MB 増える。
|
|
131
|
+
- **見直すとき**: 特になし。
|
|
132
|
+
- リポート: [06](../benchmark/reports/06-round2.md)
|
|
133
|
+
|
|
134
|
+
### キャッシュの書き込みを、別のスレッドや fork した子で行う
|
|
135
|
+
|
|
136
|
+
- **結果**: スレッドでは、`Marshal.dump` が GVL を放さず、重ねる相手(外部コマンドの待ち)も先読みで無くなった。
|
|
137
|
+
fork は試した範囲では安全で 0.7 秒ほど浮くが、木の形で書き込み自体が 0.7 秒(`~/src`)になった。
|
|
138
|
+
- **見直すとき**: キャッシュの書き込みが、また実行全体の中で目立つようになったとき。fork を使うなら、子は `exit!` で終える
|
|
139
|
+
(`exit` だと、終了時の後始末が子でも動く)。CoreFoundation を読み込んだ後の fork は避ける。
|
|
140
|
+
- リポート: [06](../benchmark/reports/06-round2.md)
|
|
141
|
+
|
|
142
|
+
### FSEvents の履歴で、変わったフォルダーだけを知る
|
|
143
|
+
|
|
144
|
+
- **ねらい**: キャッシュありの走査で残る、フォルダーごとの `lstat` を無くす。
|
|
145
|
+
- **結果**: Fiddle で呼べて、動く。キャッシュを作った後に変わった・消えた 10,465 フォルダーは、全部イベントに入っていた。
|
|
146
|
+
ただし履歴の読み出しが、直近 100 万 ID ぶんで 0.13 秒、300 万 ID 以上で 7.4〜9.3 秒かかり、走査と変わらない。
|
|
147
|
+
時刻からイベントの ID を引く関数がどの時刻にも同じ値を返し、ふだんの 1 日ぶんの量は測れていない。
|
|
148
|
+
- **見直すとき**: ふだんの 1 日ぶんの履歴の量を測れたとき(計測した日は、ベンチマークで大量にイベントが出ていた)。
|
|
149
|
+
走査の作りが大きく変わるので、効果がはっきりしてから。
|
|
150
|
+
- リポート: [06](../benchmark/reports/06-round2.md)
|
|
151
|
+
|
|
152
|
+
### スレッド数を減らす
|
|
153
|
+
|
|
154
|
+
- **結果**: `~/src` のキャッシュありの走査で、4 スレッド 11.3 秒、6 スレッド 8.6 秒、8 スレッド 8.1 秒。
|
|
155
|
+
- リポート: [06](../benchmark/reports/06-round2.md)
|
|
156
|
+
|
|
157
|
+
## 試していない候補
|
|
158
|
+
|
|
159
|
+
採用も不採用も決めていないもの。効果の見込みは [04](../benchmark/reports/04-others.md) を参照。
|
|
160
|
+
|
|
161
|
+
- **起点の外の走査を、走査の前に裏で始める。** `-d` で起点を絞った実行では、残り 9 秒のうち 6 秒ほどが、
|
|
162
|
+
起点の外の 60 か所の走査。効果は測っていない。
|
|
163
|
+
- **ハードリンクの帰属を決定的にする。** 走査の後で、inode ごとにパスが辞書順で最小のフォルダーへ付け直す。
|
|
164
|
+
見積もりは `~/src` で 0.3 秒の増加。速さではなく、結果の安定のための施策。
|
|
165
|
+
- **キャッシュ無しの走査で、小さいハードリンクの `lstat` を省く。** `getattrlistbulk` で inode と実占有も一緒に受け取れば、
|
|
166
|
+
ハードリンクごとの `lstat`(`~/src` で 30 万回)が要らなくなる。測っていない。
|
|
167
|
+
- **ホーム全体(101 万フォルダー)での計測。** 走査の時間は `~/src` までしか測っていない。
|
|
168
|
+
- **OS のファイルキャッシュが空の状態での計測。** 空にするには `sudo purge` が要るので、測っていない。
|
|
169
|
+
スレッド数などの判断が変わる可能性がある。
|
|
170
|
+
|
|
171
|
+
## 判断を変えるときの手順
|
|
172
|
+
|
|
173
|
+
1. 変更の前に `bundle exec rake "benchmark[before]"`、後に `bundle exec rake "benchmark[after]"` で測り、
|
|
174
|
+
`bundle exec rake "benchmark:compare[before,after]"` で比べる。
|
|
175
|
+
2. フィクスチャーだけで決めない。`BENCH_ROOT=~/src` のように実際のフォルダーでも測る。
|
|
176
|
+
実際のフォルダーの値はばらつくので、比べる 2 つを続けて交互に測る。
|
|
177
|
+
3. 走査の結果が変わっていないことを確かめる(合計のバイト数。読み方を変えたなら
|
|
178
|
+
`benchmark/experiments/verify_bulk_list.rb` のように、フォルダーごとの記録を突き合わせる)。
|
|
179
|
+
4. 結果をこのファイルに書き足す。環境が違うなら、「計測した環境」に並べて書く。
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
require "fileutils"
|
|
2
|
+
|
|
3
|
+
module Reclaimable
|
|
4
|
+
# AI エージェント(Claude Code・Codex など)向けのスキルの案内とインストール。
|
|
5
|
+
# スキルは Agent Skills(https://agentskills.io)の形式で、gem の ai-skill/reclaimable/ に入っている。
|
|
6
|
+
# 形式は共通だが置き場所は仕様で決まっていないので、既定の置き場所は持たず、
|
|
7
|
+
# 利用者に選んでもらう(--install-ai-skill)か、渡してもらう(--install-ai-skill=DIR)
|
|
8
|
+
class AiSkill
|
|
9
|
+
include Util
|
|
10
|
+
include I18n
|
|
11
|
+
|
|
12
|
+
NAME = "reclaimable"
|
|
13
|
+
# スキルの名前(フロントマターの name)は、ディレクトリーの名前と同じでなければならない
|
|
14
|
+
SOURCE = File.expand_path("../../ai-skill/#{NAME}", __dir__)
|
|
15
|
+
|
|
16
|
+
# 知っているスキル置き場。選択肢や案内の例として出すだけで、黙ってここに入れることはしない
|
|
17
|
+
# (エージェントの側で置き場所が変わっても、間違った場所に入れてしまわないように)。
|
|
18
|
+
# Codex は ~/.agents/skills を読む
|
|
19
|
+
def places
|
|
20
|
+
[
|
|
21
|
+
[File.join(HOME, ".claude/skills"), "Claude Code"],
|
|
22
|
+
[File.join(HOME, ".agents/skills"), _("Codex and other agents")],
|
|
23
|
+
]
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# スキルの中身と、手で入れる手順を表示する。何も書き込まない
|
|
27
|
+
def show
|
|
28
|
+
puts _("reclaimable comes with a skill for AI agents such as Claude Code and Codex. " \
|
|
29
|
+
"It tells the agent how to run reclaimable, how to read the report, and never to delete anything " \
|
|
30
|
+
"without asking you.")
|
|
31
|
+
puts
|
|
32
|
+
puts format(_("The skill is in %{dir}:"), dir: tilde(SOURCE))
|
|
33
|
+
files.each { puts " #{it}" }
|
|
34
|
+
puts
|
|
35
|
+
puts _("To install it yourself, copy that folder into the skill directory of your agent:")
|
|
36
|
+
places.each do |dir, agent|
|
|
37
|
+
puts " mkdir -p #{tilde(dir)} && cp -R #{tilde(SOURCE)} #{tilde(dir)}/ # #{agent}"
|
|
38
|
+
end
|
|
39
|
+
puts
|
|
40
|
+
puts _("To let reclaimable copy it:")
|
|
41
|
+
puts " reclaimable --install-ai-skill # " + _("asks where to install it")
|
|
42
|
+
puts " reclaimable --install-ai-skill=DIR # " + _("installs it in DIR without asking")
|
|
43
|
+
puts
|
|
44
|
+
puts _("The copy is not updated with the gem, so install it again after you update reclaimable.")
|
|
45
|
+
files.each do |file|
|
|
46
|
+
puts
|
|
47
|
+
puts "---- #{file} ----"
|
|
48
|
+
puts File.read(File.join(SOURCE, file))
|
|
49
|
+
end
|
|
50
|
+
rescue Errno::EPIPE
|
|
51
|
+
# head などにつないで途中で読むのをやめられても、エラーを出さずに終える
|
|
52
|
+
nil
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# スキル置き場 dirs のそれぞれに入れる。dirs が空なら、どこに入れるかを聞く
|
|
56
|
+
def install(dirs)
|
|
57
|
+
return install_interactively if dirs.empty?
|
|
58
|
+
|
|
59
|
+
# 渡された置き場には、聞かずに上書きする(gem を更新したあとの入れ直しを楽にするため)
|
|
60
|
+
abort unless dirs.map { copy(it) }.all?
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
private
|
|
64
|
+
|
|
65
|
+
# スキルに含まれるファイル(SOURCE からの相対パス)
|
|
66
|
+
def files = Dir.glob("**/*", base: SOURCE).select { File.file?(File.join(SOURCE, it)) }.sort
|
|
67
|
+
|
|
68
|
+
def install_interactively
|
|
69
|
+
# エージェントやスクリプトから呼ばれたときは、入力を待って固まらないよう、聞かずに止まる
|
|
70
|
+
unless $stdin.tty?
|
|
71
|
+
warn _("Cannot ask where to install the AI agent skill, because standard input is not a terminal.")
|
|
72
|
+
warn _("Give the skill directory, such as:")
|
|
73
|
+
places.each { |dir, agent| warn " reclaimable --install-ai-skill=#{tilde(dir)} # #{agent}" }
|
|
74
|
+
abort
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# 今あるスキル置き場を選択肢にする。どれも無ければ、知っているものを全部出す
|
|
78
|
+
choices = places.select { |dir, _| File.directory?(dir) }
|
|
79
|
+
choices = places if choices.empty?
|
|
80
|
+
puts _("Where do you want to install the AI agent skill?")
|
|
81
|
+
choices.each.with_index(1) do |(dir, agent), i|
|
|
82
|
+
line = " #{i}. #{tilde(dir)} (#{agent})"
|
|
83
|
+
line += " " + _("[already installed]") if File.exist?(File.join(dir, NAME))
|
|
84
|
+
puts line
|
|
85
|
+
end
|
|
86
|
+
print _("Enter numbers (such as 1, or 1 2 for both) or another skill directory. Leave it empty to cancel: ")
|
|
87
|
+
answer = $stdin.gets.to_s.strip
|
|
88
|
+
return puts(_("Canceled. Nothing was installed.")) if answer.empty?
|
|
89
|
+
|
|
90
|
+
dirs = chosen(answer, choices.map(&:first))
|
|
91
|
+
dirs.select! { confirm_overwrite(it) }
|
|
92
|
+
return puts(_("Canceled. Nothing was installed.")) if dirs.empty?
|
|
93
|
+
|
|
94
|
+
abort unless dirs.map { copy(it) }.all?
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# 答えが番号の並び(空白かカンマ区切り)なら選択肢から選び、そうでなければディレクトリーとみなす
|
|
98
|
+
def chosen(answer, choices)
|
|
99
|
+
words = answer.split(/[\s,]+/)
|
|
100
|
+
return [File.expand_path(answer)] unless words.all? { it.match?(/\A\d+\z/) }
|
|
101
|
+
|
|
102
|
+
words.map(&:to_i).uniq.map do |n|
|
|
103
|
+
choices.fetch(n - 1) { abort format(_("There is no choice %{number}. Nothing was installed."), number: n) } if n.positive?
|
|
104
|
+
end.compact
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
def confirm_overwrite(dir)
|
|
108
|
+
dest = File.join(dir, NAME)
|
|
109
|
+
return true unless File.exist?(dest) && !File.symlink?(dest)
|
|
110
|
+
|
|
111
|
+
print format(_("%{path} already exists. Overwrite it? [y/N]: "), path: tilde(dest))
|
|
112
|
+
$stdin.gets.to_s.strip.match?(/\Ay(es)?\z/i)
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# スキルを dir/reclaimable/ にコピーする。できたら true。
|
|
116
|
+
# 失敗しても、ほかの置き場には入れられるよう、理由を出して false を返す
|
|
117
|
+
def copy(dir)
|
|
118
|
+
dest = File.join(dir, NAME)
|
|
119
|
+
# スキルをシンボリックリンクで置く人もいる。リンクの先(よそのリポジトリーなど)を書き換えないよう、手を付けない
|
|
120
|
+
if File.symlink?(dest)
|
|
121
|
+
warn format(_("%{path} is a symbolic link, so nothing was written there. Remove it first to install the skill."),
|
|
122
|
+
path: tilde(dest))
|
|
123
|
+
return false
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
files.each do |file|
|
|
127
|
+
to = File.join(dest, file)
|
|
128
|
+
FileUtils.mkdir_p(File.dirname(to))
|
|
129
|
+
FileUtils.cp(File.join(SOURCE, file), to)
|
|
130
|
+
end
|
|
131
|
+
puts format(_("Installed the AI agent skill in %{path}"), path: tilde(dest))
|
|
132
|
+
true
|
|
133
|
+
rescue SystemCallError => e
|
|
134
|
+
warn format(_("Cannot install the AI agent skill in %{path}: %{error}"), path: tilde(dest), error: e.message)
|
|
135
|
+
false
|
|
136
|
+
end
|
|
137
|
+
end
|
|
138
|
+
end
|