Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot benchmark #52

Closed
remysucre opened this issue Jul 15, 2015 · 4 comments · Fixed by #196
Closed

Cannot benchmark #52

remysucre opened this issue Jul 15, 2015 · 4 comments · Fixed by #196

Comments

@remysucre
Copy link

I understand that cabal bench won't run since the suit isn't intended for "public release" as stated in the .cabal file under bench directory. But even building the bench suit on its own produces typing errors:

Building bench-bytestring-0.1.0.0...
Preprocessing executable 'bench-bytestring-builder' for
bench-bytestring-0.1.0.0...
[18 of 18] Compiling Main ( BenchAll.hs, dist/build/bench-bytestring-builder/bench-bytestring-builder-tmp/Main.o )

BenchAll.hs:133:46:
Couldn't match expected type ‘Benchmarkable’
            with actual type ‘IO ()’
In the second argument of ‘($)’, namely ‘benchIntEncodingB nRepl e’
In the expression:
  bench (name ++ " (" ++ show nRepl ++ ")")
  $ benchIntEncodingB nRepl e

Should this be fixed or should the suit just disappear?

@sjakobi
Copy link
Member

sjakobi commented Dec 19, 2019

I'm also failing to build the benchmarks, even with GHC 7.0:

$ cabal build bench-bytestring -w ghc-7.0.4
...
BenchAll.hs:231:15: Not in scope: `getDataFileName'

With more recent GHC versions there are additional errors:

$ cabal build bench-bytestring -w ghc-8.0.2
...
BenchAll.hs:136:46: error:
    • Couldn't match expected type ‘Benchmarkable’
                  with actual type ‘IO ()’
    • In the second argument of ‘($)’, namely
        ‘benchIntEncodingB nRepl e’
      In the expression:
        bench (name ++ " (" ++ show nRepl ++ ")")
        $ benchIntEncodingB nRepl e
      In an equation for ‘benchBE’:
          benchBE name e
            = bench (name ++ " (" ++ show nRepl ++ ")")
              $ benchIntEncodingB nRepl e

BenchAll.hs:169:13: error:
    • Couldn't match type ‘Word8’ with ‘Int’
      Expected type: Word8 -> Word8
        Actual type: Int -> Word8
    • In the expression: fromIntegral . hashInt . w
      In an equation for ‘hashWord8’:
          hashWord8 = fromIntegral . hashInt . w

BenchAll.hs:169:38: error:
    • Couldn't match type ‘Word8’ with ‘Int’
      Expected type: Int -> Int
        Actual type: Int -> Word8
    • In the second argument of ‘(.)’, namely ‘w’
      In the second argument of ‘(.)’, namely ‘hashInt . w’
      In the expression: fromIntegral . hashInt . w

BenchAll.hs:231:15: error:
    Variable not in scope: getDataFileName :: [Char] -> IO FilePath

@hsyl20
Copy link
Contributor

hsyl20 commented Dec 19, 2019

I have fixed most errors here: https://github.com/hsyl20/bytestring/tree/hsyl20-fix-benchmarks

Just use stack build in bench directory and then stack exec -- some-benchmark

@sjakobi
Copy link
Member

sjakobi commented Dec 19, 2019

@hsyl20 Awesome! Are you going to make a PR or should I try to take it from there?

@hsyl20
Copy link
Contributor

hsyl20 commented Dec 19, 2019

There are merge conflicts due to recent merges in master. E.g. version bounds conflict on blaze-builder: perhaps we should ditch it completely (recent blaze-builder seems to use bytestring).

No PR from me soon. I don't have much time to fix this so I would prefer if you or someone else could take it from here. :)

@sjakobi sjakobi mentioned this issue Dec 20, 2019
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants