Created
December 28, 2023 02:49
-
-
Save apainintheneck/c048d1abf346a322964e02c6b9875428 to your computer and use it in GitHub Desktop.
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
# Benchmarking things to explore `brew desc` without a cache. | |
# See: https://github.com/Homebrew/brew/issues/16237 | |
Benchmark.bm do |x| | |
x.report("JSON") do | |
Homebrew::API::Formula.all_formulae | |
end | |
x.report("Ruby") do | |
CoreTap.instance.formula_files.map do |file| | |
Formulary.factory(file) | |
end | |
end | |
x.report("Cache") do | |
CacheStoreDatabase.use(:descriptions) do |db| | |
db.empty? | |
end | |
end | |
end | |
# On Old iMac | |
# ----------- | |
# user system total real | |
# JSON 0.633890 0.073619 0.707509 ( 0.709061) | |
# Ruby 16.119298 2.291271 18.433785 ( 19.035318) | |
# Cache 0.005555 0.000541 0.006096 ( 0.006521) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The JSON parser was around twice as fast on my new MacBook.