forked from anoma/juvix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Rename Frontend to Parsing * Fix benchmarks * [ci] changes from CI Co-authored-by: drone <noreply@drone>
- Loading branch information
1 parent
f23ebb8
commit c0207f1
Showing
71 changed files
with
381 additions
and
348 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
module Context where | ||
|
||
import qualified Criterion.Main as Criterion | ||
import qualified Juvix.Backends.LLVM as LLVM | ||
import qualified Juvix.Desugar as Desugar | ||
import Juvix.Library hiding (mod) | ||
import qualified Juvix.Library.Feedback as Feedback | ||
import qualified Juvix.Parsing.Parser as Parser | ||
import qualified Juvix.Pipeline as Pipeline | ||
import qualified Juvix.Pipeline.ToSexp as ToSexp | ||
import qualified Text.Megaparsec as P | ||
|
||
bench :: Criterion.Benchmark | ||
bench = | ||
Criterion.bgroup | ||
"desugar" | ||
[guardTest] | ||
|
||
guardTest :: Criterion.Benchmark | ||
guardTest = | ||
Criterion.env | ||
( liftIO $ | ||
Feedback.runFeedbackT $ | ||
Pipeline.toML | ||
LLVM.BLLVM | ||
( "" | ||
<> "mod Let where\n" | ||
<> "open Prelude\n" | ||
<> "sig (==) : field -> field -> bool\n" | ||
<> "let (==) = %LLVM.eq\n" | ||
<> "declare infixl (==) 2\n" | ||
<> "let foo | x == 3 = 3 | else = 2" | ||
) | ||
) | ||
( \ ~(Feedback.Success _ t) -> | ||
Criterion.bgroup | ||
"guardTest" | ||
[ Criterion.bench "guard small WHNF" $ | ||
Criterion.whnfIO (either (panic . show) identity <$> ToSexp.contextify t), | ||
Criterion.bench "guard small NF" $ | ||
Criterion.nfIO (either (panic . show) identity <$> ToSexp.contextify t) | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
module Main where | ||
|
||
import qualified Context | ||
import qualified Criterion.Main as Criterion | ||
import qualified Frontend.Parser as Parser | ||
import qualified FrontendDesugar | ||
import Juvix.Library | ||
|
||
main :: IO () | ||
main = | ||
Criterion.defaultMain | ||
[ Parser.bench, | ||
FrontendDesugar.bench | ||
Context.bench | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.