forked from JuliaLang/www_old.julialang.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
benchmarks.jl
31 lines (27 loc) · 1.02 KB
/
benchmarks.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using DataFrames
using Gadfly
benchmarks = readtable("benchmarks.csv", names=[:language, :benchmark, :time])
cdata = benchmarks[benchmarks[:language].== "c", :]
benchmarks = join(benchmarks, cdata, on=:benchmark)
benchmarks[:time]./= benchmarks[:time_1]
benchmarks[:language] = PooledDataArray(benchmarks[:language])
benchmarks[:benchmark] = PooledDataArray(benchmarks[:benchmark])
benchmarks = benchmarks[benchmarks[:language].!= "c", :]
benchmarks[:language] = setlevels!(benchmarks[:language], Dict{UTF8String,Any}(
[lang => (lang == "javascript" ? "JavaScript" : ucfirst(lang)) for lang in benchmarks[:language]]))
p = plot(benchmarks,
x = :language,
y = :time,
color = :benchmark,
Scale.y_log10,
Guide.ylabel(nothing),
Guide.xlabel(nothing),
Theme(
default_point_size = 1mm,
guide_title_position = :left,
colorkey_swatch_shape = :circle,
minor_label_font = "Georgia",
major_label_font = "Georgia",
),
)
draw(SVG("_includes/benchmarks.svg", 8inch, 8inch/golden), p)