In []:
using DataFrames
using Gadfly

benchmarks = DataFrame(readcsv("benchmarks.csv"),["language", "benchmark", "time"])
benchmarks = join(benchmarks, subset(benchmarks, :(language .== "c")), on="benchmark", kind=:outer)
within!(benchmarks, :(time ./= time_1))
benchmarks["language"] = PooledDataArray(benchmarks["language"])
benchmarks["language"] = reorder(benchmarks["language"], benchmarks["time"])
benchmarks["benchmark"] = PooledDataArray(benchmarks["benchmark"])
benchmarks["benchmark"] = reorder(benchmarks["benchmark"], benchmarks["time"])
benchmarks = benchmarks[:(language .!= "c"),:]
benchmarks["language"] = set_levels!(benchmarks["language"], Dict{Any,Any}(benchmarks["language"],
  [ lang == "javascript" ? "JavaScript" : ucfirst(lang) for lang in benchmarks["language"]]));
Warning: New definition 
    formatter(Array
{T,N},Date{C<:Calendar}...)
is ambiguous with: 
    formatter(Array{T,N},FloatingPoint...).
To fix, define 
    formatter(Array{T,N},)
before the new definition.

In [1]:
set_default_plot_size(9inch, 9inch/golden)
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",
    ),
    # Geom.hline(size=0.25mm, color="darkgray"), yintercept=[1,2],
    Geom.point,
)
Out[1]:
In [2]:
draw(SVG("_includes/benchmarks.svg", 8inch, 4inch), p)
Back to top