Skip to content

Instantly share code, notes, and snippets.

@astojanov
Created March 25, 2016 02:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save astojanov/3be5b2b8e93d71b70970 to your computer and use it in GitHub Desktop.
Save astojanov/3be5b2b8e93d71b70970 to your computer and use it in GitHub Desktop.
install.packages("ggplot2")
library(ggplot2)
getLegend <- function() { return(theme(legend.position="bottom")) }
getTitle <- function(tmp) { return(ggtitle(tmp)) }
getAxisTextElement <- function() { return(element_text(hjust=0.5, size=8, colour="black")) }
getAxisTitleElement <- function() { return(element_text(hjust=0.5, size=10)) }
getTitleElement <- function () { return(element_text(hjust=0, size=10)) }
colorPalette <- c("#000000", "#585858", "#585858", "#585858", "#585858", "#585858", "#585858")
shapePalette <- c(16, 23, 24, 25, 22)
shapeSizes <- c(2, 2, 2, 2, 2, 2)
serie_0_ivybridge <- data.frame(x=c(32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 480, 512, 544, 576, 608, 640, 672, 704, 736, 768, 800, 832, 864, 896, 928, 960, 992, 1024, 1056, 1088, 1120, 1152, 1184, 1216, 1248, 1280, 1312, 1344, 1376, 1408, 1440, 1472, 1504, 1536, 1568, 1600, 1632, 1664, 1696, 1728, 1760, 1792, 1824, 1856, 1888, 1920, 1952, 1984, 2016, 2048), y=c(885437, 1252924, 1764503, 2281164, 2515027, 2994829, 3441402, 3948331, 5447157, 5988028, 7367077, 6655573, 10422214, 10812782, 12136759, 12112629, 15688684, 19328020, 18261694, 20061008, 23830502, 24453829, 28842192, 27606378, 35483972, 37011015, 39214973, 40754995, 48756377, 43246667, 44519302, 45510639, 53439297, 64569533, 60595468, 70324270, 82105048, 72814990, 84296460, 92752604, 91545856, 93913319, 99275690, 115509713, 118492206, 120284880, 114563635, 133934593, 164638996, 167629296, 154896125, 168169605, 199634190, 184721311, 193206705, 180229516, 207570133, 249169609, 239471341, 222321306, 230690294, 218300338, 258605414, 209431342), series="OpenSSL 1.0.2d (9 Jul 2015)");
serie_1_ivybridge <- data.frame(x=c(32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 480, 512, 544, 576, 608, 640, 672, 704, 736, 768, 800, 832, 864, 896, 928, 960, 992, 1024, 1056, 1088, 1120, 1152, 1184, 1216, 1248, 1280, 1312, 1344, 1376, 1408, 1440, 1472, 1504, 1536, 1568, 1600, 1632, 1664, 1696, 1728, 1760, 1792, 1824, 1856, 1888, 1920, 1952, 1984, 2016, 2048), y=c(186686, 299536, 641668, 826893, 1785214, 1992438, 2791943, 3428075, 4214690, 4337536, 6701558, 7546526, 8436711, 9480389, 11668983, 13584437, 17241681, 16520576, 21516287, 24802098, 27514854, 29849765, 33132586, 36583755, 35114258, 43952640, 48262195, 46601751, 52410058, 50606704, 69618964, 63408206, 81071966, 75120525, 85618867, 84610187, 90115194, 110666549, 98415061, 125744936, 127491475, 139070131, 169710402, 161125887, 161299595, 171791293, 177343480, 186330587, 169619741, 210376199, 250603389, 201435962, 262439289, 264860924, 237551983, 281669094, 256592516, 278610890, 323279677, 295475174, 367290499, 366272625, 393837716, 408127906), series="IPP Crypto AVX 8.2.0r43166 (Jul 7 2014)");
plot_df_ivybridge <- do.call(rbind, list(serie_0_ivybridge, serie_1_ivybridge));
plot_ivybridge <- ggplot(plot_df_ivybridge, aes(x, y, colour=series, shape=series)) +
getTitle("Intel Integrated Performance Primitives Cryptography vs OpenSSL (RSA Key Generation) \nIntel(R) Core(TM) i7-3720Q CPU @ 2.60 GHz (Ivy Bridge)\n\nCPU Cycles (log)") +
xlab("RSA Key Size") +
geom_line() +
geom_point(aes(size=series), fill = "white") +
theme(
panel.grid.minor.y = element_blank(),
panel.grid.minor.x = element_blank(),
legend.title=element_blank(),
axis.title.y=element_blank(),
axis.line = element_line(colour = "white"),
axis.line.x = element_line(colour = "black"),
axis.text = getAxisTextElement(),
axis.title = getAxisTitleElement(),
plot.title = getTitleElement()
) +
getLegend() +
scale_colour_manual(values=colorPalette) +
scale_shape_manual(values=shapePalette) +
scale_size_manual(values=shapeSizes) +
scale_y_log10()
serie_0_haswell <- data.frame(x=c(32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 480, 512, 544, 576, 608, 640, 672, 704, 736, 768, 800, 832, 864, 896, 928, 960, 992, 1024, 1056, 1088, 1120, 1152, 1184, 1216, 1248, 1280, 1312, 1344, 1376, 1408, 1440, 1472, 1504, 1536, 1568, 1600, 1632, 1664, 1696, 1728, 1760, 1792, 1824, 1856, 1888, 1920, 1952, 1984, 2016, 2048), y=c(875546, 1198334, 1638724, 2200192, 2377156, 3272978, 3634174, 3844255, 5882580, 5442084, 6889004, 7214096, 9821360, 10776087, 12623326, 13426777, 16920398, 17547757, 19612405, 23006958, 22241061, 23286870, 26220067, 28504583, 37748132, 38612876, 40831396, 38093551, 41588565, 47759542, 53215744, 53835908, 60106846, 64572204, 69849954, 69879146, 78671897, 75831208, 94965934, 102173881, 100387541, 94968397, 124468459, 100439958, 107786109, 113294104, 122293218, 118819487, 170401232, 161472427, 182595545, 147164921, 176477960, 170385523, 196147833, 224329959, 210141012, 244944397, 273033517, 249746106, 244425328, 265324485, 277903600, 312911734), series="OpenSSL 1.1.0-pre4 beta (16 Mar 2016)");
serie_1_haswell <- data.frame(x=c(32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 480, 512, 544, 576, 608, 640, 672, 704, 736, 768, 800, 832, 864, 896, 928, 960, 992, 1024, 1056, 1088, 1120, 1152, 1184, 1216, 1248, 1280, 1312, 1344, 1376, 1408, 1440, 1472, 1504, 1536, 1568, 1600, 1632, 1664, 1696, 1728, 1760, 1792, 1824, 1856, 1888, 1920, 1952, 1984, 2016, 2048), y=c(186686, 299536, 641668, 826893, 1785214, 1992438, 2791943, 3428075, 4214690, 4337536, 6701558, 7546526, 8436711, 9480389, 11668983, 13584437, 17241681, 16520576, 21516287, 24802098, 27514854, 29849765, 33132586, 36583755, 35114258, 43952640, 48262195, 46601751, 52410058, 50606704, 69618964, 63408206, 81071966, 75120525, 85618867, 84610187, 90115194, 110666549, 98415061, 125744936, 127491475, 139070131, 169710402, 161125887, 161299595, 171791293, 177343480, 186330587, 169619741, 210376199, 250603389, 201435962, 262439289, 264860924, 237551983, 281669094, 256592516, 278610890, 323279677, 295475174, 367290499, 366272625, 393837716, 408127906), series="IPP Crypto AVX2 8.2.0r43166 (Jul 7 2014)");
plot_df_haswell <- do.call(rbind, list(serie_0_haswell, serie_1_haswell));
plot_haswell <- ggplot(plot_df_haswell, aes(x, y, colour=series, shape=series)) +
getTitle("Intel Integrated Performance Primitives Cryptography vs OpenSSL (RSA Key Generation) \nIntel(R) Xeon(R) CPU E3-1285L v3 @ 3.10GHz (Haswell)\n\nCPU Cycles (log)") +
xlab("RSA Key Size") +
geom_line() +
geom_point(aes(size=series), fill = "white") +
theme(
panel.grid.minor.y = element_blank(),
panel.grid.minor.x = element_blank(),
legend.title=element_blank(),
axis.title.y=element_blank(),
axis.line = element_line(colour = "white"),
axis.line.x = element_line(colour = "black"),
axis.text = getAxisTextElement(),
axis.title = getAxisTitleElement(),
plot.title = getTitleElement()
) +
getLegend() +
scale_colour_manual(values=colorPalette) +
scale_shape_manual(values=shapePalette) +
scale_size_manual(values=shapeSizes) +
scale_y_log10()
plot_ivybridge
plot_haswell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment