1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 23:11:50 +03:00
This commit is contained in:
Patrick Thomson 2018-03-07 19:47:23 -05:00
parent 0ac705b0f5
commit be2d90f029
6 changed files with 58 additions and 8 deletions

View File

@ -7,12 +7,17 @@ import Data.Monoid
pyEval :: FilePath -> Benchmarkable
pyEval = whnfIO . evaluatePythonFile . ("bench/bench-fixtures/python/" <>)
rbEval :: FilePath -> Benchmarkable
rbEval = whnfIO . evaluateRubyFile . ("bench/bench-fixtures/ruby/" <>)
main :: IO ()
main = defaultMain [
bgroup "python" [ bench "assignment" $ pyEval "simple-assignment.py"
main = defaultMain
[ bgroup "python" [ bench "assignment" $ pyEval "simple-assignment.py"
, bench "function def" $ pyEval "function-definition.py"
, bench "if + function calls" $ pyEval "if-statement-functions.py"
]
, bgroup "ruby" [ bench "assignment" $ rbEval "simple-assignment.rb"
, bench "function def" $ rbEval "function-definition.rb"
, bench "if + function calls" $ rbEval "if-statement-functions.rb"
]
]

View File

@ -4,11 +4,11 @@ def a():
def c(d):
e
def g(g, *h,):
def g(g, *h):
i
def h(i=j):
def h(i=1):
i
def i(j:str="default", **c):
def i(j="default", **c):
j

View File

@ -2,11 +2,11 @@ def foo(): return "bipp"
def bar(): return foo()
def baz(): return baz()
def baz(): return bar()
def why(): return "elle"
if True:
foo()
baz()
else:
why()

View File

@ -0,0 +1,19 @@
def a()
"b"
end
def c(d)
"e"
end
def g(g_)
"i"
end
def h(i=1)
i
end
def i()
"j"
end

View File

@ -0,0 +1,21 @@
def foo()
"bipp"
end
def bar()
foo()
end
def baz()
bar()
end
def why()
return "elle"
end
if true
baz()
else
why()
end

View File

@ -0,0 +1,5 @@
foo = 2
bar = foo
dang = 3
song = dang
song