From c888047bee36d131bcfc485cc352745366bfef3b Mon Sep 17 00:00:00 2001 From: Cassie Jones Date: Sat, 2 Nov 2019 03:15:53 -0400 Subject: [PATCH] Polishing --- .eleventy.js | 3 + _includes/layouts/layout.njk | 22 +- _includes/layouts/post.njk | 2 +- archive.njk | 13 + imgs/2018-08-27-violin-f32.svg | 554 +++++++++++++++++++++++++++++++++ imgs/2018-08-27-violin-i32.svg | 445 ++++++++++++++++++++++++++ index.njk | 6 +- posts/2018/min-benchmark.md | 4 +- static/prism.css | 153 +++++++++ 9 files changed, 1187 insertions(+), 15 deletions(-) create mode 100644 archive.njk create mode 100644 imgs/2018-08-27-violin-f32.svg create mode 100644 imgs/2018-08-27-violin-i32.svg create mode 100644 static/prism.css diff --git a/.eleventy.js b/.eleventy.js index 3d62916..38ba442 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -9,6 +9,9 @@ module.exports = (eleventyConfig) => { eleventyConfig.addPlugin(pluginRss); eleventyConfig.addPlugin(pluginSyntaxHighlight); + eleventyConfig.addPassthroughCopy("img"); + eleventyConfig.addPassthroughCopy("static"); + eleventyConfig.addNunjucksShortcode("youtube", youtubeShortcode); eleventyConfig.addPairedNunjucksShortcode("tweet", tweetShortcode); eleventyConfig.addFilter("markdown", value => md.renderInline(value)); diff --git a/_includes/layouts/layout.njk b/_includes/layouts/layout.njk index b738c1c..51581ab 100644 --- a/_includes/layouts/layout.njk +++ b/_includes/layouts/layout.njk @@ -9,25 +9,29 @@ body { padding: 1em; max-width: 700px; margin: 0 auto; } body header { margin-bottom: 1em; } body footer { margin-top: 1em; } h1 { margin: 0; } -h1 a { color: #f78123; text-decoration: none; } h1, h2, h3, h4, h5, h6 { margin-bottom: 0; } +.c-sun { color: #f78123; } +.dec-none { text-decoration: none; } +.dim { color: #777; } .flex-center { justify-content: center; } .row { display: flex; flex-direction: row; } .col { display: flex; flex-direction: column; } +.baseline { align-items: baseline; } .spacer { flex-grow: 1; } .ls-none { list-style: none; padding: 0; margin: 0; } -code { font-size: 1.1em; } -pre code { overflow: scroll; width: calc(100% + 8em); display: inline-block; max-width: 100vw; font-size: 1em; - background: #eee; box-sizing: border-box; margin: 0 -4em; padding: 1em; border-radius: 6px; } -@media (max-width: calc(700px + 8em)) { - pre code { margin: 0 -1em; width: calc(100% + 2em); } -} +
-

Witch of Light

- A collection of Cassie's harebrained schemes. +
+

Witch of Light

+
+ Archive +     + RSS +
+ A collection of Cassie's harebrained schemes.
{{ content | safe }}
diff --git a/_includes/layouts/post.njk b/_includes/layouts/post.njk index 77dc832..50ab444 100644 --- a/_includes/layouts/post.njk +++ b/_includes/layouts/post.njk @@ -5,7 +5,7 @@ permalink: "/{{ page.date | date('YYYY') }}/{{ page.fileSlug }}/index.html"

{{ title }}

-Published {{ page.date | date('YYYY-MM-DD') }} +Published {{ page.date | date('YYYY-MM-DD') }}
{{ content | safe }}
diff --git a/archive.njk b/archive.njk new file mode 100644 index 0000000..266620d --- /dev/null +++ b/archive.njk @@ -0,0 +1,13 @@ +--- +layout: "layouts/layout.njk" +--- + + diff --git a/imgs/2018-08-27-violin-f32.svg b/imgs/2018-08-27-violin-f32.svg new file mode 100644 index 0000000..746b7bd --- /dev/null +++ b/imgs/2018-08-27-violin-f32.svg @@ -0,0 +1,554 @@ + + + +Gnuplot +Produced by GNUPLOT 5.2 patchlevel 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + f32/min_tree_f32! + + + + + f32/min_f32! + + + + + f32/iter + + + + + f32/min_iter_f32[array] + + + + + f32/min_iter_f32 + + + + + + + + + + + + + 7.5 + + + + + + + + + + + + + 8 + + + + + + + + + + + + + 8.5 + + + + + + + + + + + + + 9 + + + + + + + + + + + + + 9.5 + + + + + + + + + + + + + 10 + + + + + + + + + + + + + 10.5 + + + + + + + + + + + + + 11 + + + + + + + + + Input + + + + + Average time (ns) + + + + + f32: Violin plot + + + PDF + + + PDF + + + + + + + + + + gnuplot_plot_2 + + + + + + + gnuplot_plot_3 + + + + + + + gnuplot_plot_4 + + + + + + + gnuplot_plot_5 + + + + + + + + + + + + + + + + + + + diff --git a/imgs/2018-08-27-violin-i32.svg b/imgs/2018-08-27-violin-i32.svg new file mode 100644 index 0000000..d202fe9 --- /dev/null +++ b/imgs/2018-08-27-violin-i32.svg @@ -0,0 +1,445 @@ + + + +Gnuplot +Produced by GNUPLOT 5.2 patchlevel 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + i32/min_tree! + + + + + i32/min! + + + + + i32/iter + + + + + + + + + + + + + 2 + + + + + + + + + + + + + 2.5 + + + + + + + + + + + + + 3 + + + + + + + + + + + + + 3.5 + + + + + + + + + + + + + 4 + + + + + + + + + + + + + 4.5 + + + + + + + + + + + + + 5 + + + + + + + + + + + + + 5.5 + + + + + + + + + + + + + 6 + + + + + + + + + + + + + 6.5 + + + + + + + + + + + + + 7 + + + + + + + + + Input + + + + + Average time (ns) + + + + + i32: Violin plot + + + PDF + + + PDF + + + + + + + + + + gnuplot_plot_2 + + + + + + + gnuplot_plot_3 + + + + + + + + + + + + + + + + + + + diff --git a/index.njk b/index.njk index c824c59..93dd65f 100644 --- a/index.njk +++ b/index.njk @@ -4,9 +4,9 @@ layout: "layouts/layout.njk" diff --git a/posts/2018/min-benchmark.md b/posts/2018/min-benchmark.md index f4e9580..55ee21e 100644 --- a/posts/2018/min-benchmark.md +++ b/posts/2018/min-benchmark.md @@ -94,7 +94,7 @@ Looking at [godbolt output][] for a hardcoded case shows that they all get vecto Criterion produces really cool graphs. Here's the results from the two cases: -![violin-i32](/images/2018-08-27-violin-i32.svg) -![violin-f32](/images/2018-08-27-violin-f32.svg) +![violin-i32](/imgs/2018-08-27-violin-i32.svg) +![violin-f32](/imgs/2018-08-27-violin-f32.svg) I suspect if you want to compute the minimum of a *very* large list, you'll benefit from doing tree reductions on independent chunks in a loop. diff --git a/static/prism.css b/static/prism.css new file mode 100644 index 0000000..94952ad --- /dev/null +++ b/static/prism.css @@ -0,0 +1,153 @@ +/* PrismJS 1.17.1 +https://prismjs.com/download.html#themes=prism */ +/** + * prism.js default theme for JavaScript, CSS and HTML + * Based on dabblet (http://dabblet.com) + * @author Lea Verou + */ + +code[class*="language-"], +pre[class*="language-"] { + color: black; + background: none; + text-shadow: 0 1px white; + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + font-size: 18px; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.3; + + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} + +pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection, +code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection { + text-shadow: none; + background: #b3d4fc; +} + +pre[class*="language-"]::selection, pre[class*="language-"] ::selection, +code[class*="language-"]::selection, code[class*="language-"] ::selection { + text-shadow: none; + background: #b3d4fc; +} + +@media print { + code[class*="language-"], + pre[class*="language-"] { + text-shadow: none; + } +} + +/* Code blocks */ +pre[class*="language-"] { + overflow: auto; + width: calc(100% + 8em); + margin: 0 -4em; + display: inline-block; + max-width: 100vw; + font-size: 18px; + background: #eee; + box-sizing: border-box; + padding: 1em; + border-radius: 6px; +} + +@media (max-width: calc(700px + 9em)) { + pre[class*="language-"] { margin: 0 -1em; width: calc(100% + 2em); } +} + +:not(pre) > code[class*="language-"], +pre[class*="language-"] { + background: #f5f2f0; +} + +/* Inline code */ +:not(pre) > code[class*="language-"] { + padding: .1em; + border-radius: .3em; + white-space: normal; +} + +.token.comment, +.token.prolog, +.token.doctype, +.token.cdata { + color: slategray; +} + +.token.punctuation { + color: #999; +} + +.namespace { + opacity: .7; +} + +.token.property, +.token.tag, +.token.boolean, +.token.number, +.token.constant, +.token.symbol, +.token.deleted { + color: #905; +} + +.token.selector, +.token.attr-name, +.token.string, +.token.char, +.token.builtin, +.token.inserted { + color: #690; +} + +.token.operator, +.token.entity, +.token.url, +.language-css .token.string, +.style .token.string { + color: #9a6e3a; + background: hsla(0, 0%, 100%, .5); +} + +.token.atrule, +.token.attr-value, +.token.keyword { + color: #07a; +} + +.token.function, +.token.class-name { + color: #DD4A68; +} + +.token.regex, +.token.important, +.token.variable { + color: #e90; +} + +.token.important, +.token.bold { + font-weight: bold; +} +.token.italic { + font-style: italic; +} + +.token.entity { + cursor: help; +} + -- 2.43.2