Skip to content

Instantly share code, notes, and snippets.

@meiersi
meiersi / gist:3823539
Created October 2, 2012 21:51
benchmarks_before_pull_request
Running 1 benchmarks...
Benchmark benchmarks: RUNNING...
warming up
estimating clock resolution...
mean is 1.272820 us (640001 iterations)
found 155815 outliers among 639999 samples (24.3%)
4 (6.3e-4%) low severe
155811 (24.3%) high severe
estimating cost of a clock call...
mean is 34.57473 ns (12 iterations)
@meiersi
meiersi / gist:3823534
Created October 2, 2012 21:50
benchmarks_after_pull_request
Running 1 benchmarks...
Benchmark benchmarks: RUNNING...
warming up
estimating clock resolution...
mean is 1.357818 us (640001 iterations)
found 3790 outliers among 639999 samples (0.6%)
3077 (0.5%) high severe
estimating cost of a clock call...
mean is 35.68071 ns (12 iterations)
found 2 outliers among 12 samples (16.7%)
@meiersi
meiersi / CollatzLength.hs
Created July 25, 2012 22:46
Solution to Euler Problem 14 using memoization via a lazy array
-- inspired by: http://scrollingtext.org/project-euler-problem-14
-- executing main takes 5 sec in ghci
-- 0.7 sec when compiled with -O
import qualified Data.Vector as V
n :: Integer
n = 1000000
cacheSize :: Int
@meiersi
meiersi / gist:2666171
Created May 12, 2012 11:59
benchmarks of blaze-binary using GHC 7.4.1
benchmarked against: https://github.com/meiersi/blaze-binary/commit/d2bc3f004f608ebdd1eece624f288a263753bb36
and https://github.com/kolmodin/binary/commit/abbf46373620b45caca64e1072b300379e9c0fa1
warming up
estimating clock resolution...
mean is 1.466016 us (640001 iterations)
found 3590 outliers among 639999 samples (0.6%)
2943 (0.5%) high severe
estimating cost of a clock call...
mean is 36.12254 ns (13 iterations)
@meiersi
meiersi / gist:2488098
Created April 25, 2012 08:09
Benchmarking bytestring to hex conversion
-- Copyright : (c) 2012 Michael Snoyman, Simon Meier
-- License : BSD3-style (see LICENSE)
--
-- Maintainer : Simon Meier <iridcode@gmail.com>
-- Stability : experimental
-- Portability : tested on GHC only
--
-- Benchmark hexadecimal encoding speed. Use the preview repository of the new
-- bytestring builder to test this code:
--
@meiersi
meiersi / gist:2487861
Created April 25, 2012 07:44
Decimal encoding speed
-- |
-- Copyright : (c) 2012 Simon Meier
-- License : BSD3-style (see LICENSE)
--
-- Maintainer : Simon Meier <iridcode@gmail.com>
-- Stability : experimental
-- Portability : tested on GHC only
--
-- Benchmark decimal encoding speed of 10 million integers.
--
@meiersi
meiersi / lists_of_size_10
Created April 24, 2012 19:39
Benchmark results from comparing cereal, binary, and the new bytestring builder on https://github.com/meiersi/cereal/blob/master/bench/BenchAll.hs
└─╼ ./cabal-dev/bin/cereal-bench
Sanity checks:
lengths of input data: [11,11,11,11,11,11,11]
cereal :/[Int]: 96
binary :/[Int]: 96
new builder :/[Int]: 100
new builder2:/[Int]: 96
cereal :/[String]: 138
binary :/[String]: 138
@meiersi
meiersi / gist:2362561
Created April 11, 2012 21:02
benchmarking bytestring to hex-string conversion
./dist/build/bench-bytestring-builder/bench-bytestring-builder snoyman
Sanity checks:
lengths of input data: [10001,10001,10001,10001,10001,10001,10001]
warming up
estimating clock resolution...
mean is 5.480878 us (160001 iterations)
found 3843 outliers among 159999 samples (2.4%)
3403 (2.1%) high severe
estimating cost of a clock call...
@meiersi
meiersi / gist:1754062
Created February 6, 2012 18:56
aeson benchmarks
benchmarking decode/en/aeson
mean: 1.549123 ms, lb 1.519203 ms, ub 1.589703 ms, ci 0.950
std dev: 177.1128 us, lb 137.1106 us, ub 225.7957 us, ci 0.950
found 10 outliers among 100 samples (10.0%)
3 (3.0%) high mild
7 (7.0%) high severe
variance introduced by outliers: 83.157%
variance is severely inflated by outliers