Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Graph code for JIT comparison blog post
library(ggplot2)
library(reshape2)
jit <- read.csv("~/Desktop/jit.csv")
#Melt data into proper format
jitm <- melt(jit, id.vars='numsearch')
jitm$value = log(jitm$value)
#Create Overall ggplot for ln performance
ggplot(jitm) +
theme_bw(base_family="Garamond") +
theme(text = element_text(size=20)) +
ggtitle("Language Speed Comparison\n") +
xlab("\nFactorial Divisor Search") +
ylab("ln(seconds)\n") +
geom_line(aes(x=numsearch, y=value, colour=variable), size=1.2) +
guides(colour = guide_legend(title=NULL, override.aes = list(size=3))) +
scale_x_continuous(breaks=5:20) +
scale_y_continuous(breaks=NULL) +
scale_color_manual(values=c("slateblue2", "goldenrod1", "springgreen3", "lightsalmon2", "gray30", "darkgreen", "gold3", "pink"))
#Create ggplot for ln performance
#Python
python <- subset(jitm, variable == "python" | variable == "pypy" | variable == "python.numba.autojit")
ggplot(python) +
theme_bw(base_family="Garamond") +
theme(text = element_text(size=20)) +
ggtitle("Language Speed Comparison - Python\n") +
xlab("\nFactorial Divisor Search") +
ylab("ln(seconds)\n") +
geom_line(aes(x=numsearch, y=value, colour=variable), size=1.2) +
guides(colour = guide_legend(title=NULL, override.aes = list(size=3))) +
scale_x_continuous(breaks=5:20) +
scale_y_continuous(breaks=NULL) +
scale_color_manual(values=c("slateblue2", "goldenrod1", "springgreen3", "lightsalmon2", "gray30", "darkgreen", "gold3", "pink"))
#Create ggplot for ln performance
#R
r <- subset(jitm, variable == "r" | variable == "r.compiled" | variable == "pqr" | variable == "pqr.compiled")
ggplot(r) +
theme_bw(base_family="Garamond") +
theme(text = element_text(size=20)) +
ggtitle("Language Speed Comparison - R\n") +
xlab("\nFactorial Divisor Search") +
ylab("ln(seconds)\n") +
geom_line(aes(x=numsearch, y=value, colour=variable), size=1.2) +
guides(colour = guide_legend(title=NULL, override.aes = list(size=3))) +
scale_x_continuous(breaks=5:20) +
scale_y_continuous(breaks=NULL) +
scale_color_manual(values=c("slateblue2", "goldenrod1", "springgreen3", "lightsalmon2", "gray30", "darkgreen", "gold3", "pink"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.