Nothing
drat::addRepo("csgillespie") rsconnect::deployApp(appDir = "~/github/benchmarkme-data/inst/shinyapps_io/", account="jumpingrivers", server = "shinyapps.io", appTitle = "benchmarkme" )
library("shiny") library("flexdashboard") library("benchmarkmeData") library("plotly") data("past_results_v2", package="benchmarkmeData") source("functions.R")
Select the machines you are interested in
## The shiny part selectInput("byte", "Byte compiled", c("All", "Standard", "Optimised")) selectInput("blas", "Blas", c("All", "Standard", "Optimised")) selectInput("os", "Operating system", c("All", "Linux", "Apple", "Windows", "Unix")) checkboxInput("is_parallel", "Parallel benchmarks", TRUE) selectInput("test", "Benchmark test", c("Programming", "Matrix functions", "Matrix calulations", "Read 5MB", "Read 50MB","Read 200MB", "Write 5MB", "Write 50MB", "Write 200MB")) fileInput("results", "Upload results file") user_rank = NULL results = reactive({ if(!is.null(input$results)) { user_data = readRDS(file = input$results$datapath) user_results = summarise_results(user_data) all_results = rbind(past_results, user_results) user_id = unique(user_data$id) } else { all_results = past_results user_id = NULL } #res = select_results("prog", all_results) res = select_results("prog", all_results, parallel = TRUE) blas = get_option(input$blas) byte = get_option(input$byte) is_parallel = input$is_parallel res = select_results(get_test(input$test), all_results, byte_optimize = byte, blas_optimize = blas, parallel = is_parallel) res$is_user = FALSE res$is_user[res$id == user_id] = TRUE res = clean_table(res) if(input$os != "All") res = res[res$sysname == input$os,] colnames(res) = c("id", "Rank", "Time", "CPU", "Byte Compile", "BLAS Opt", "OS", "RAM (GB)", "Test", "Cores", "is_user") res = res[,c(TRUE, !is_parallel, TRUE, TRUE, is.null(byte), is.null(blas), input$os == "All", TRUE, input$Test == "All", TRUE, is_parallel, TRUE)] if(nrow(res) > 0) res$Rank = 1:nrow(res) res }) br() renderUI({ ret = NULL user_rank = which(results()$is_user) if(!is.null(input$results)) { ret = paste(ret, "File uploaded.", br(), br()) if(sum(user_rank) > 0) { ret = paste(ret, "Your machine is ranked", user_rank, "out of", nrow(results()), "machines") } else { ret = paste(ret, br(), "For the current selection, your own machine isn't displayed") } } HTML(ret) }) div(class="div-wrapper", a(href="http://www.jumpingrivers.com", img(src = "logo.png", style="width:150px;") ) )
DT::renderDataTable({ r = results() data_table = DT::datatable(results()[,-c(1, ncol(r))], rownames=FALSE) if(sum(r$is_user) > 0) { DT::formatStyle(data_table, "Rank", backgroundColor = DT::styleEqual(which(r$is_user), "orange")) } else { data_table } })
library(plotly) renderPlotly({ res = results() if(nrow(res) > 0) { res$size = res$is_user + 6 res$size[res$is_user] = 16 res$colour = "black" res$colour[res$is_user] = "steelblue" if(!input$is_parallel) { plot_ly(res, x = ~Rank, y = ~`Time`, type="scatter", marker = list(color = ~colour, width=10, size=~size), # color= ~is_user, size=~size, text = ~paste("CPU: ", CPU)) %>% layout(yaxis = list(type = "log", title = "Time (sec)")) } else { saveRDS(res, file = "/tmp/tmp.rds") plot_ly(res, x = ~Cores, y = ~`Time`, type="scatter", marker = list(color = ~colour, width=10, size=~size), # color= ~is_user, size=~size, text = ~paste("CPU: ", CPU)) %>% add_lines(color=~id) %>% layout(yaxis = list(type = "log", title = "Normalised time (to 1 core)"), showlegend = FALSE) } } else { plot_ly() } })
library(plotly) renderPlotly({ if(!input$is_parallel && nrow(results()) > 0) { relative = (results()$Time/min(results()$Time)) plot_ly(results(), x = ~Rank, y = ~relative, text = ~paste("CPU: ", CPU)) %>% layout(yaxis = list(type = "log", title = "Relative time")) } else { plot_ly() } })
total = function(i) sum(i > 0, na.rm = TRUE) renderPlotly({ i3 = total(regexpr("i3", results()$CPU)) i5 = total(regexpr("i5", results()$CPU)) i7 = total(regexpr("i7", results()$CPU)) xeon = total(regexpr("Xeon", results()$CPU)) amd = total(regexpr("AMD", results()$CPU)) plot_ly( x = c(paste("Intel", c("i3", "i5", "i7", "Xeon")), "AMD"), y = c(i3, i5, i7, xeon, amd), name = "CPU distribution", type = "bar" ) })
renderPlotly({ ram = table(results()$`RAM (GB)`) n = as.numeric(as.character(names(ram))) x_axis = factor(n) plot_ly( x = x_axis, y = ram, name = "CPU distribution",type = "bar" ) })
total = function(i) sum(i > 0, na.rm = TRUE) renderPlotly({ OS = sort(table(results()$OS)) nam = as.character(names(OS)) plot_ly( x = nam, y = as.vector(OS), name = "OS distribution", type = "bar" ) })
There are two main benchmarks in this package:
benchmark_std()
benchmark_prog
,
benchmark_matrix_cal
, and benchmark_matrix_fun
benchmark_io()
read
and write
.The benchmark_prog
benchmark consists of timing five matrix programming operations:
bm_prog_fib
.bm_prog_hilbert
.bm_prog_gcd
.bm_prog_toeplitz
.bm_prog_escoufier
.A collection of matrix benchmark functions aimed at assessing the calculation speed.
bm_matrix_cal_manip
.bm_matrix_cal_power
.bm_matrix_cal_sort
.bm_matrix_cal_cross_product
bm_matrix_cal
.A collection of matrix benchmark functions
bm_matrix_fun_fft
.bm_matrix_fun_eigen
.bm_matrix_fun_determinant
.bm_matrix_fun_cholesky
.bm_matrix_fun_inverse
.The purpose of this benchmark isn't to compare write.csv
to another package. Instead,
we went to assess your machine.
These benchmarks have been developed by many authors.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.