criterion

Generating HTML output from criterion

坚强是说给别人听的谎言 提交于 2020-02-01 01:39:22
问题 There is a nice example of HTML output from criterion at http://bos.github.com/criterion/. Which command line option is used to generate this output? An answer to a related question asserts that this output exits, but it does not seem to show up in the command line options when using --help . 回答1: Well if you just want html output, then yourBench -o yourReport.html will generate some perfectly reasonable output. If you want to use your own template, look at the templates/report.tpl example in

GHC Haskell performance of IPv4 address rendering

这一生的挚爱 提交于 2020-01-02 07:27:29
问题 I recently built a library for handling IPv4 address in haskell. I have written two functions to render an IPv4 address to Text and I am surprised that the naive approach outperforms the approach that I actually thought about. Here are the relevant pieces. First, there is the definition of IPv4: newtype IPv4 = IPv4 { getIPv4 :: Word32 } Next we have the IP address renderer that I expected to perform well: toDotDecimalText :: IPv4 -> Text toDotDecimalText = LText.toStrict . TBuilder.toLazyText

Type error using Criterion

依然范特西╮ 提交于 2019-12-11 04:02:25
问题 I read the documentation and some articles that talk about the package, but I'm new to Haskell and did not understand much but I tried .... Below is what I did: module Main where {-# LANGUAGE BangPatterns #-} import Control.Parallel(par,pseq) import Control.Exception import Data.List import IO import Data.Char import Criterion.Main (defaultMain, bench) learquivo :: FilePath -> IO ([[Int]]) learquivo "mkList1.txt" = do conteudo <- readFile "mkList1.txt" return (read conteudo) main =

capabilities of criterion

末鹿安然 提交于 2019-12-10 14:14:03
问题 I found some old examples of the use of criterion here. It looks as if back in 2009 it was supporting command line options for drawing graphs. Now, when I import criterion 0.6, wrap it in a basic application (to test it) and say ./application --help it gives only vert little available options and nothing related to drawing. It seems to me as if concerning output formats and capabilities it had more features in 2009 than it has in 2012? There seems to be a criterion-to-html that creates basic

GHC Haskell performance of IPv4 address rendering

自古美人都是妖i 提交于 2019-12-06 03:15:56
I recently built a library for handling IPv4 address in haskell. I have written two functions to render an IPv4 address to Text and I am surprised that the naive approach outperforms the approach that I actually thought about. Here are the relevant pieces. First, there is the definition of IPv4 : newtype IPv4 = IPv4 { getIPv4 :: Word32 } Next we have the IP address renderer that I expected to perform well: toDotDecimalText :: IPv4 -> Text toDotDecimalText = LText.toStrict . TBuilder.toLazyText . toDotDecimalBuilder {-# INLINE toDotDecimalText #-} toDotDecimalBuilder :: IPv4 -> TBuilder.Builder

Cabal install criterion out of memory

自作多情 提交于 2019-12-04 06:32:29
问题 I'm running on a container with 768MB ram and 512 MB swap space. I can't increase either of this. cabal install criterion always gives Failed during the building phase. The exception was: ExitFailure (-9) This may be due to an out-of-memory condition. during Compiling Criterion.Types . Is there any way around this or do I have to make do without criterion? 回答1: Set RTS flags on GHC to limit its memory usage ( --ghc-options="+RTS -M600M" ) and avoid running multiple jobs in parallel ( -j1 ).

Generating HTML output from criterion

不打扰是莪最后的温柔 提交于 2019-12-04 02:04:31
There is a nice example of HTML output from criterion at http://bos.github.com/criterion/ . Which command line option is used to generate this output? An answer to a related question asserts that this output exits, but it does not seem to show up in the command line options when using --help . Well if you just want html output, then yourBench -o yourReport.html will generate some perfectly reasonable output. If you want to use your own template, look at the templates/report.tpl example in the distribution and use the -t option. Sorry I didn't get around to your comment-question. The answer

Global / local environment affects Haskell's Criterion benchmarks results

≯℡__Kan透↙ 提交于 2019-12-02 03:44:22
问题 We're benchmarking some Haskell code in our company and we've just hit a very strange case. Here is a code, which benchmarks the same thing 2 times. The former one uses an Criterion.env which is created for all the tests once, the later creates env for every test. This is the only difference, however the one which creates env for each bench, runs 5 times faster. Does anyone know what can cause it? Minimal example: module Main where import Prelude import Control.Monad import qualified Data

Global / local environment affects Haskell's Criterion benchmarks results

China☆狼群 提交于 2019-12-02 00:18:56
We're benchmarking some Haskell code in our company and we've just hit a very strange case. Here is a code, which benchmarks the same thing 2 times. The former one uses an Criterion.env which is created for all the tests once, the later creates env for every test. This is the only difference, however the one which creates env for each bench, runs 5 times faster. Does anyone know what can cause it? Minimal example: module Main where import Prelude import Control.Monad import qualified Data.Vector.Storable.Mutable as Vector import qualified Data.Vector.Storable as Vector import Data.Vector

How to use Criterion to measure performance of Haskell programs?

走远了吗. 提交于 2019-11-30 04:55:53
I'm trying to measure the performance of a simple Haar DWT program using the Criterion framework. (It is erroneously slow, but I'll leave that for another question). I can't find any good documentation on the web, unfortunately. My two primary problems are How can one pass data from one benchmark to another? I want to time each stage of the program. How does the sampling work, and avoid lazy evaluation reusing its previous computations? This source is relatively pared down; the first function getRandList generates a list of random numbers; haarStep transforms an input signal into differences