-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add benchmarks and update Plutarch version #5
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The module layout makes sense. It just needs a bit of cleaning up (export lists, comments, generally more haddocks on top-level definitions)
|
||
## Target Performance | ||
|
||
The target performance for our library is a reduction of 30% ex-units across the above benchmarks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there something missing in the report?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Report (M1) was just providing benchmarks for Plinth / Aiken and establishing our target benchmarks (which we stated must be an improvement upon existing benchmarks). What we actually achieved was (in most cases) much better than the above target (often 80%+ reduction in ex-units).
{-# LANGUAGE GADTs #-} | ||
{-# LANGUAGE RankNTypes #-} | ||
|
||
module Plutarch.Core.FieldBinds where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing export list
{-# LANGUAGE QualifiedDo #-} | ||
{-# LANGUAGE PolyKinds #-} | ||
{-# LANGUAGE OverloadedRecordDot #-} | ||
module Plutarch.Core.Time where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing export list
@@ -0,0 +1,134 @@ | |||
{-# LANGUAGE OverloadedRecordDot #-} | |||
|
|||
module Plutarch.Core.ValidationLogic where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing export list
{-# LANGUAGE RankNTypes #-} | ||
{-# LANGUAGE PartialTypeSignatures #-} | ||
|
||
module Plutarch.Core.Value where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Export list
import Plutarch.MerkleTree.Helpers (pcombine, pnibble, pnibbles, | ||
psuffix) | ||
import Plutarch.MerkleTree.Merkling (pmerkle_16, pnull_hash, | ||
psparse_merkle_16) | ||
import Plutarch.Prelude | ||
import PlutusLedgerApi.V2 (BuiltinByteString) | ||
import PlutusTx.Builtins.Internal (BuiltinByteString (BuiltinByteString)) | ||
--import PlutusLedgerApi.V2 (BuiltinByteString) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete comment
|
||
instance PUnsafeLiftDecl PMerklePatriciaForestry where | ||
type PLifted PMerklePatriciaForestry = MerklePatriciaForestry | ||
-- instance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete comment
-- type AsHaskell PMerklePatriciaForestry = BuiltinByteString | ||
-- type PlutusRepr PMerklePatriciaForestry = PLiftedClosed PMerklePatriciaForestry | ||
|
||
instance {-# OVERLAPPING #-} PLiftable PMerklePatriciaForestry where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need the overlappable pragma here?
{-# INLINEABLE fromPlutarch #-} | ||
fromPlutarch = fromPlutarchUni | ||
|
||
-- deriving via |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete comment
Also the build is failing because of some warnings |
@@ -16,7 +16,7 @@ repository cardano-haskell-packages | |||
|
|||
index-state: | |||
, hackage.haskell.org 2024-10-10T00:52:24Z | |||
, cardano-haskell-packages 2024-10-24T10:49:32Z | |||
, cardano-haskell-packages 2024-10-09T22:38:57Z |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we going backwards in time here?
I have introduced benchmarks and updated the Plutarch version. The benchmark results are extremely promising. The custom library functions blow the standard library ones out of the water:
Recursive
is the std lib equivalent when it exists, fast is our optimized implementation. The results are astonishing, our implementations are often dozens of times more efficient even for trivial functions likelength
.