Skip to content

Commit

Permalink
Kwxm/bitwise/enable nqueens benchmark (IntersectMBO#6343)
Browse files Browse the repository at this point in the history
This enables the bitwise `nqueens` benchmark following the fix for `writeBits` in Plinth in IntersectMBO#6309.

```
$ cabal bench bitwise-bench
Build profile: -w ghc-9.6.6 -O1
In order, the following will be built (use -v for more details):
 - plutus-benchmark-0.1.0.0 (bench:bitwise-bench) (first run)
Preprocessing benchmark 'bitwise-bench' for plutus-benchmark-0.1.0.0...
Building benchmark 'bitwise-bench' for plutus-benchmark-0.1.0.0...
Running 1 benchmarks...
Benchmark bitwise-bench: RUNNING...
benchmarking 8-queens
time                 683.4 ms   (681.5 ms .. 685.0 ms)
                     1.000 R²   (1.000 R² .. 1.000 R²)
mean                 678.6 ms   (674.1 ms .. 680.4 ms)
std dev              3.211 ms   (92.63 μs .. 3.978 ms)
variance introduced by outliers: 19% (moderately inflated)

Benchmark bitwise-bench: FINISH
```
  • Loading branch information
Kenneth MacKenzie authored and v0d1ch committed Dec 6, 2024
1 parent d04a2ca commit caad2cc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
14 changes: 5 additions & 9 deletions plutus-benchmark/bitwise/bench/Main.hs
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TemplateHaskell #-}

module Main (main) where

{-
import Criterion.Main (bench, defaultMain)
import PlutusBenchmark.Common (benchProgramCek, mkMostRecentEvalCtx)
import PlutusBenchmark.NQueens (nqueens)
import PlutusTx.Code (CompiledCode, getPlcNoAnn)
import PlutusTx.Plugin ()
import PlutusTx.TH (compile)
-}

main :: IO ()
main = print "Pending"

{- Currently not able to run, due to problems with writeBits compiling under PlutusTx

main :: IO ()
main = defaultMain [
Expand All @@ -21,6 +18,5 @@ main = defaultMain [
-- Helpers

nqueensCompiled :: CompiledCode [(Integer, Integer)]
nqueensCompiled = $$(compile [||nqueens 8||])
nqueensCompiled = $$(compile [|| nqueens 8 ||])

-}
14 changes: 7 additions & 7 deletions plutus-benchmark/plutus-benchmark.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -618,10 +618,10 @@ benchmark bitwise-bench
type: exitcode-stdio-1.0
main-is: Main.hs
hs-source-dirs: bitwise/bench
build-depends: base >=4.9 && <5

-- , bitwise-internal
-- , criterion
-- , plutus-benchmark-common
-- , plutus-tx ^>=1.30
-- , plutus-tx-plugin ^>=1.30
build-depends:
, base >=4.9 && <5
, bitwise-internal
, criterion
, plutus-benchmark-common
, plutus-tx ^>=1.31
, plutus-tx-plugin ^>=1.31

0 comments on commit caad2cc

Please sign in to comment.