Questions tagged [haskell-criterion]

Criterion is a library for benchmarking Haskell code. For questions related to (N)Hibernate Criteria, use the [criteria] tag.

Links

46 questions
2
votes
1 answer

Global / local environment affects Haskell's Criterion benchmarks results

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…
Wojciech Danilo
  • 11,573
  • 17
  • 66
  • 132
2
votes
2 answers

Type error using Criterion

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…
Gmp
  • 179
  • 10
2
votes
0 answers

overhead of cabal run

I need to benhmark another project in my program, and right now I'm doing system $ "cd " ++ projDir ++ "; cabal build" let runProj = system $ "cd " ++ projDir ++ "; cabal run > /dev/null" (m, _) <- measure (whnfIO runProj) runs with…
rem
  • 893
  • 4
  • 18
2
votes
0 answers

Haskell Criterion Benchmark on lazy encode

We're trying to benchmark binary encoding with Criterion. Since the data types are strict, we are perfectly able to benchmark the process of packing a Request. However, one step further by trying to benchmark the process of encode (Request to…
Marc Juchli
  • 2,240
  • 24
  • 20
2
votes
1 answer

Can criterion be used for profiling concurrency across multiple cores?

I notice that when I run a criterion benchmark (which does no forkIO or par) compiled with -O2 -rtsopts -threaded -eventlog and +RTS -N2 -ls that real work (not just GC) is spread across both cores. A quick grep of the criterion source didn't show…
jberryman
  • 16,334
  • 5
  • 42
  • 83
1
vote
2 answers

Haskell Criterion Usage Error

The following code named fib.hs import Criterion.Main (defaultMain) fibZ = 1:1:zipWith (+) fibZ (tail fibZ) main = defaultMain [ bench "fibZ 10" $ \n -> fibZ (10+n-n) ] errors with fib.hs:45:10: Not in scope: `bench' What is wrong?…
Nordlöw
  • 11,838
  • 10
  • 52
  • 99
1
vote
0 answers

File from assignment has import Haskell stack does not recognize

I got a download file from my University for one of my assignments, it has an import Criterion.Main that my version of stack does not recognize I tried updating my Stack and cabal, added #!/usr/bin/env stack to the beginning of my file, and tried…
Am Akkaya
  • 11
  • 2
1
vote
1 answer

Haskell Criterion: Could not load module, hidden package

When I do exactly what this Criterion tutorial says to do to get started, I get an error. What am I doing wrong? Is the tutorial wrong? If so, is there a place that I can learn the right way to use Criterion? Specifically, as the tutorial says, I…
embradley
  • 475
  • 1
  • 5
  • 14
1
vote
1 answer

Invalid Criterion report when testing on large inputs with AutoBench

I am working with AutoBench since a few days testing performances of Euler's sieve on different input sizes. My tests simply asks for the nth prime inside the list generated by Euler's sieve. While Criterion works well on small inputs for n, it…
1
vote
1 answer

How can I reduce the criterion benchmark time?

I'm trying to use the criterion library to do some benchmarking. I've tried a simple example: module Main where import Criterion.Types import Criterion.Main myConfig :: Config myConfig = defaultConfig { resamples = 1 …
Chris Stryczynski
  • 30,145
  • 48
  • 175
  • 286
1
vote
1 answer

Haskell Criterion - 'nf' is applied to too few arguments

I am a new guy to Haskell. I am working a benchmark(Criteriaon) on binary search algorithm. I keep getting error: 'nf' is applied to too few arguments what am I doing wrong. Thanks binSear array serNum lowInx highInx | highInx < lowInx =…
MatejKr
  • 115
  • 12
1
vote
0 answers

Criterion: Is it possible to alter Benchark graph?

I just started using the excellent criterion package and I was wondering if it's possible to alter the graph. For example I would need to normalize result within a group so that the longest result of a group take the full width of the graph…
mb14
  • 22,276
  • 7
  • 60
  • 102
0
votes
2 answers

Could not find module ‘Criterion.Main’ when trying to benchmark haskell

I cannot get Criterion to work. I followed the tutorial here, installing Criterion by doing the following. cabal update cabal install -j --disable-tests criterion when I try ghc -O Fibber.hs or ghc -O --make Fibber I receive the error [1 of 1]…
Liam White
  • 121
  • 6
0
votes
0 answers

Benchmarking with criterion takes too long

I have a few benchmarks that would like to test using criterion. The problem is that the function I am trying to benchmark may take a very long time(100 seconds). My setup is something like this benchmarks128StatesMediumFormulas = [ bench…
0
votes
1 answer

Passing a randomly generated list as a parameter in Haskell

I am new to Haskell and really having trouble with the whole IO thing. I am trying to find out how long it takes to traverse a list in haskell. I wanted to generate a list of random numbers and pass it as a parameter to a function so that I can…
AR17
  • 39
  • 4