Skip to content

Commit

Permalink
Bench 2023
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerjl committed Dec 2, 2023
1 parent bd68046 commit 3d38b28
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
2 changes: 2 additions & 0 deletions benchmark/Bench.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import Criterion.Main (bench, bgroup, defaultMain)
import qualified Y2015.Bench
import qualified Y2016.Bench
import qualified Y2021.Bench
import qualified Y2023.Bench

main :: IO ()
main = defaultMain
[ Y2015.Bench.benchmarks
, Y2016.Bench.benchmarks
, Y2021.Bench.benchmarks
, Y2023.Bench.benchmarks
]
16 changes: 8 additions & 8 deletions benchmark/Space.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ main = do
(measurements, config) <- weighResults $ do
wgroup "Y2021" do
wgroup "D08" do
func "Y2021.D08.A" (solve 2021 8 'a') d8
func "Y2021.D08.B" (solve 2021 8 'b') d8
func "Y2021.D08.A" (solve 2021 8 'a' []) (pure d8)
func "Y2021.D08.B" (solve 2021 8 'b' []) (pure d8)
wgroup "D09" do
func "Y2021.D09.A" (solve 2021 9 'a') d9
func "Y2021.D09.B" (solve 2021 9 'b') d9
func "Y2021.D09.A" (solve 2021 9 'a' []) (pure d9)
func "Y2021.D09.B" (solve 2021 9 'b' []) (pure d9)
wgroup "D011" do
func "Y2021.D011.A" (solve 2021 11 'a') d11
func "Y2021.D011.B" (solve 2021 11 'b') d11
func "Y2021.D011.A" (solve 2021 11 'a' []) (pure d11)
func "Y2021.D011.B" (solve 2021 11 'b' []) (pure d11)
wgroup "D012" do
func "Y2021.D012.A" (solve 2021 12 'a') d12
func "Y2021.D012.B" (solve 2021 12 'b') d12
func "Y2021.D012.A" (solve 2021 12 'a' []) (pure d12)
func "Y2021.D012.B" (solve 2021 12 'b' []) (pure d12)

let (labels, allocs, gcs) = unzip3 $ flip concatMap measurements \(Grouped year days) -> concatMap sumData days
points = zipWith Point allocs (map into gcs)
Expand Down
2 changes: 1 addition & 1 deletion docs/haddock/Y2023-D01.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>Y2023.D01</title><link href="linuwial.css" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="quick-jump.css" /><link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=PT+Sans:400,400i,700" /><script src="haddock-bundle.min.js" async="async" type="text/javascript"></script><script type="text/x-mathjax-config">MathJax.Hub.Config({ tex2jax: { processClass: "mathjax", ignoreClass: ".*" } });</script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script></head><body><div id="package-header"><span class="caption">adventofcode-0.1.0.0: Haskell solutions to adventofcode</span><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul></div><div id="content"><div id="module-header"><table class="info"><tr><th>License</th><td>MIT</td></tr><tr><th>Maintainer</th><td>@tylerjl</td></tr><tr><th>Safe Haskell</th><td>Safe-Inferred</td></tr><tr><th>Language</th><td>Haskell2010</td></tr></table><p class="caption">Y2023.D01</p></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Solutions to the 2023 day 01 set of problems for <a href="adventofcode.com">adventofcode.com</a>.</p></div></div><div id="synopsis"><details id="syn"><summary>Synopsis</summary><ul class="details-toggle" data-details-id="syn"><li class="src short"><a href="#v:partA">partA</a> :: <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-String.html#t:String" title="Data.String">String</a> -&gt; <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a></li><li class="src short"><a href="#v:partB">partB</a> :: <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-String.html#t:String" title="Data.String">String</a> -&gt; <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a></li><li class="src short"><a href="#v:base10Tuple">base10Tuple</a> :: (<a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a>, <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a>) -&gt; <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a></li><li class="src short"><a href="#v:intoPair">intoPair</a> :: [<a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a>] -&gt; <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Maybe.html#t:Maybe" title="Data.Maybe">Maybe</a> (<a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a>, <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a>)</li><li class="src short"><a href="#v:calibrateA">calibrateA</a> :: <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-String.html#t:String" title="Data.String">String</a> -&gt; [[<a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a>]]</li><li class="src short"><a href="#v:calibrateB">calibrateB</a> :: <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-String.html#t:String" title="Data.String">String</a> -&gt; [[<a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a>]]</li></ul></details></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a id="v:partA" class="def">partA</a> :: <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-String.html#t:String" title="Data.String">String</a> -&gt; <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a> <a href="#v:partA" class="selflink">#</a></p><div class="doc"><p>Solve for part A</p></div></div><div class="top"><p class="src"><a id="v:partB" class="def">partB</a> :: <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-String.html#t:String" title="Data.String">String</a> -&gt; <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a> <a href="#v:partB" class="selflink">#</a></p><div class="doc"><p>Solve for part B</p></div></div><div class="top"><p class="src"><a id="v:base10Tuple" class="def">base10Tuple</a> :: (<a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a>, <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a>) -&gt; <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a> <a href="#v:base10Tuple" class="selflink">#</a></p><div class="doc"><p>Turn a tuple into a two-digit number</p></div></div><div class="top"><p class="src"><a id="v:intoPair" class="def">intoPair</a> :: [<a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a>] -&gt; <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Maybe.html#t:Maybe" title="Data.Maybe">Maybe</a> (<a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a>, <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a>) <a href="#v:intoPair" class="selflink">#</a></p><div class="doc"><p>Given a list of ints, try and turn it into a tuple of first and
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>Y2023.D01</title><link href="linuwial.css" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="quick-jump.css" /><link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=PT+Sans:400,400i,700" /><script src="haddock-bundle.min.js" async="async" type="text/javascript"></script><script type="text/x-mathjax-config">MathJax.Hub.Config({ tex2jax: { processClass: "mathjax", ignoreClass: ".*" } });</script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script></head><body><div id="package-header"><span class="caption">adventofcode-0.1.0.0: Haskell solutions to adventofcode</span><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul></div><div id="content"><div id="module-header"><table class="info"><tr><th>License</th><td>MIT</td></tr><tr><th>Maintainer</th><td>@tylerjl</td></tr><tr><th>Safe Haskell</th><td>Safe-Inferred</td></tr><tr><th>Language</th><td>Haskell2010</td></tr></table><p class="caption">Y2023.D01</p></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Solutions to the 2023 day 01 set of problems for <a href="adventofcode.com">adventofcode.com</a>.</p></div></div><div id="synopsis"><details id="syn"><summary>Synopsis</summary><ul class="details-toggle" data-details-id="syn"><li class="src short"><a href="#v:part1A">part1A</a> :: <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-String.html#t:String" title="Data.String">String</a> -&gt; <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a></li><li class="src short"><a href="#v:part1B">part1B</a> :: <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-String.html#t:String" title="Data.String">String</a> -&gt; <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a></li><li class="src short"><a href="#v:base10Tuple">base10Tuple</a> :: (<a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a>, <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a>) -&gt; <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a></li><li class="src short"><a href="#v:intoPair">intoPair</a> :: [<a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a>] -&gt; <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Maybe.html#t:Maybe" title="Data.Maybe">Maybe</a> (<a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a>, <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a>)</li><li class="src short"><a href="#v:calibrateA">calibrateA</a> :: <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-String.html#t:String" title="Data.String">String</a> -&gt; [[<a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a>]]</li><li class="src short"><a href="#v:calibrateB">calibrateB</a> :: <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-String.html#t:String" title="Data.String">String</a> -&gt; [[<a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a>]]</li></ul></details></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a id="v:part1A" class="def">part1A</a> :: <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-String.html#t:String" title="Data.String">String</a> -&gt; <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a> <a href="#v:part1A" class="selflink">#</a></p><div class="doc"><p>Solve for part A</p></div></div><div class="top"><p class="src"><a id="v:part1B" class="def">part1B</a> :: <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-String.html#t:String" title="Data.String">String</a> -&gt; <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a> <a href="#v:part1B" class="selflink">#</a></p><div class="doc"><p>Solve for part B</p></div></div><div class="top"><p class="src"><a id="v:base10Tuple" class="def">base10Tuple</a> :: (<a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a>, <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a>) -&gt; <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a> <a href="#v:base10Tuple" class="selflink">#</a></p><div class="doc"><p>Turn a tuple into a two-digit number</p></div></div><div class="top"><p class="src"><a id="v:intoPair" class="def">intoPair</a> :: [<a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a>] -&gt; <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Maybe.html#t:Maybe" title="Data.Maybe">Maybe</a> (<a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a>, <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a>) <a href="#v:intoPair" class="selflink">#</a></p><div class="doc"><p>Given a list of ints, try and turn it into a tuple of first and
last elements, with Nothing as the result if it can&#8217;t be done.</p></div></div><div class="top"><p class="src"><a id="v:calibrateA" class="def">calibrateA</a> :: <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-String.html#t:String" title="Data.String">String</a> -&gt; [[<a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a>]] <a href="#v:calibrateA" class="selflink">#</a></p><div class="doc"><p>Transform an input string into a list of all the digits found in
each line.</p></div></div><div class="top"><p class="src"><a id="v:calibrateB" class="def">calibrateB</a> :: <a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-String.html#t:String" title="Data.String">String</a> -&gt; [[<a href="file:///nix/store/biyi9kkik889n04fc74kj5fxx5b9pdns-ghc-9.2.8-doc/share/doc/ghc/html/libraries/base-4.16.4.0/Data-Int.html#t:Int" title="Data.Int">Int</a>]] <a href="#v:calibrateB" class="selflink">#</a></p><div class="doc"><p>Transform an input string into a list of all the digits and
spelled numbers found in each line.</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.26.0</p></div></body></html>
Loading

0 comments on commit 3d38b28

Please sign in to comment.