Skip to content

Commit

Permalink
Kwxm/bitwise/enable nqueens benchmark (#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 #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 Jul 26, 2024
1 parent bfac69f commit 5571f53
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

1 comment on commit 5571f53

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Plutus Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.05.

Benchmark suite Current: 5571f53 Previous: bfac69f Ratio
validation-currency-1 256.4 μs 244.1 μs 1.05

This comment was automatically generated by workflow using github-action-benchmark.

CC: @IntersectMBO/plutus-core

Please sign in to comment.