Skip to content

Instantly share code, notes, and snippets.

@jlouis
Created April 18, 2018 22:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlouis/5668bbfe42a8bd617e54fdb9dcd2ee8e to your computer and use it in GitHub Desktop.
Save jlouis/5668bbfe42a8bd617e54fdb9dcd2ee8e to your computer and use it in GitHub Desktop.
Toying
[jlouis@lady-of-pain tmp]$ cat foo.csv
BenchmarkBlake2B/1-8 5000000 303 ns/op 3.29 MB/s 0 B/op 0 allocs/op
BenchmarkBlake2B/2-8 5000000 317 ns/op 6.30 MB/s 0 B/op 0 allocs/op
BenchmarkBlake2B/4-8 5000000 304 ns/op 13.14 MB/s 0 B/op 0 allocs/op
BenchmarkBlake2B/8-8 5000000 301 ns/op 26.51 MB/s 0 B/op 0 allocs/op
BenchmarkBlake2B/32-8 5000000 312 ns/op 102.44 MB/s 0 B/op 0 allocs/op
BenchmarkBlake2B/64-8 5000000 282 ns/op 226.20 MB/s 0 B/op 0 allocs/op
BenchmarkBlake2B/128-8 5000000 251 ns/op 509.27 MB/s 0 B/op 0 allocs/op
BenchmarkBlake2B/256-8 3000000 439 ns/op 582.19 MB/s 0 B/op 0 allocs/op
BenchmarkBlake2B/512-8 2000000 770 ns/op 664.14 MB/s 0 B/op 0 allocs/op
BenchmarkBlake2B/1024-8 1000000 1412 ns/op 724.91 MB/s 0 B/op 0 allocs/op
BenchmarkBlake2B/4096-8 300000 5049 ns/op 811.13 MB/s 0 B/op 0 allocs/op
BenchmarkBlake2B/8192-8 200000 9476 ns/op 864.46 MB/s 0 B/op 0 allocs/op
[jlouis@lady-of-pain tmp]$ awk '{ print $1 "," $3 "," $5 }' foo.csv > data.csv
R scripting session. You may have to run 'install.packages("ggplot2")' first
x <- read.csv('data.csv', header=FALSE)
library(ggplot2)
q <- ggplot(x, aes(V1, V2))
q + geom_col() + coord_flip()
You can now do stuff such as:
> png("b2.png")
> q + geom_col() + coord_flip()
> dev.off()
You probably need to give it some width and height options to make it avoid
scaling the fonts too much. But hopefully, this wil get you going
@bieniusa
Copy link


title: "Go Benchmarks"
author: "AB"
date: "19 4 2018"
output: html_document

require(ggplot2)
require(dplyr)
require(tidyr) 
require(stringr)
df <- read.csv('data.csv', header=FALSE,sep="\t")
df <- df %>% 
  separate(V1, c("Name","X"), sep = "/") %>% 
  separate(X, c("Threads","Y"), sep = "-") %>%   
  mutate(Throughput = as.integer(str_replace(V3," ns/op", "")))
q <- ggplot(data = df, aes(x = Threads, y = Throughput)) 
q + geom_point(aes(shape=Name))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment