1
1
mirror of https://github.com/github/semantic.git synced 2024-12-26 16:33:03 +03:00

Add a ruby benchmark

This commit is contained in:
Timothy Clem 2020-01-07 09:25:12 -08:00
parent 04feec6182
commit c4d83a8ff1

View File

@ -35,8 +35,9 @@ import Semantic.Task.Files
benchmarks :: Benchmark benchmarks :: Benchmark
benchmarks = bgroup "tagging" benchmarks = bgroup "tagging"
[ pythonBenchmarks -- [ pythonBenchmarks
, goBenchmarks -- , goBenchmarks
[ rubyBenchmarks
] ]
pythonBenchmarks :: Benchmark pythonBenchmarks :: Benchmark
@ -53,6 +54,13 @@ goBenchmarks = bgroup "go"
] ]
where dir = Path.relDir "tmp/go-examples/go/src/database/sql" where dir = Path.relDir "tmp/go-examples/go/src/database/sql"
rubyBenchmarks :: Benchmark
rubyBenchmarks = bgroup "ruby"
[ bench "precise" $ runTagging preciseLanguageModes dir "*.rb"
, bench "a la carte" $ runTagging aLaCarteLanguageModes dir "*.rb"
]
where dir = Path.relDir "tmp/ruby-examples/ruby_spec/language"
runTagging :: PerLanguageModes -> Path.RelDir -> String -> Benchmarkable runTagging :: PerLanguageModes -> Path.RelDir -> String -> Benchmarkable
runTagging mode dir glob = nfIO . withOptions testOptions $ \ config logger statter -> do runTagging mode dir glob = nfIO . withOptions testOptions $ \ config logger statter -> do
let session = TaskSession config "-" False logger statter let session = TaskSession config "-" False logger statter