From f8d2a2d6176d86f3b26af9dd2c0011a67159372e Mon Sep 17 00:00:00 2001 From: Timothy Clem Date: Mon, 6 Jul 2020 14:04:27 -0700 Subject: [PATCH] Just use top level benchmarks --- semantic-tags/bench/Main.hs | 33 ------------------------------- semantic-tags/semantic-tags.cabal | 12 ----------- 2 files changed, 45 deletions(-) delete mode 100644 semantic-tags/bench/Main.hs diff --git a/semantic-tags/bench/Main.hs b/semantic-tags/bench/Main.hs deleted file mode 100644 index a4a869683..000000000 --- a/semantic-tags/bench/Main.hs +++ /dev/null @@ -1,33 +0,0 @@ -module Main (main) where - -import Tags.Tagging.Precise -import qualified Data.ByteString as B -import Gauge -import Source.Loc (Loc (..)) -import Source.Range -import Source.Source as Source -import Source.Span (Pos (..), Span (..)) -import Data.Char (ord) - -main :: IO () -main = do - bytes <- fmap fromUTF8 $ B.readFile "/Users/tclem/github/github/app/models/user.rb" - -- bytes <- fmap fromUTF8 $ B.readFile "/Users/tclem/Downloads/jquery-3.5.1.min.js" - -- let lineIndexes = B.elemIndices (toEnum (ord '\n')) (Source.bytes bytes) - defaultMain - -- [ baselineCalculateLine bytes - -- , calculateLinePRVersion bytes - [ calculateLineWithMap bytes - ] - --- baselineCalculateLine :: Source -> Benchmark --- baselineCalculateLine bytes = bench "baseline calculateLineAndSpans" $ do --- nf (baselineCalculateLineAndSpans bytes) (Loc (Range 73754 73757) (Span (Pos 1 73669) (Pos 1 73672))) - --- calculateLinePRVersion :: Source -> Benchmark --- calculateLinePRVersion bytes = bench "calculateLineAndSpansPRVersion " $ do --- nf (calculateLineAndSpansPRVersion bytes) (Loc (Range 73754 73757) (Span (Pos 1 73669) (Pos 1 73672))) - -calculateLineWithMap :: Source -> Benchmark -calculateLineWithMap src = bench "calculateLineAndSpansWithIndexes" $ do - nf (calculateLineAndSpans src (LineIndices mempty)) (Loc (Range 73754 73757) (Span (Pos 1 73669) (Pos 1 73672))) diff --git a/semantic-tags/semantic-tags.cabal b/semantic-tags/semantic-tags.cabal index a1d8358be..c12d4e98f 100644 --- a/semantic-tags/semantic-tags.cabal +++ b/semantic-tags/semantic-tags.cabal @@ -66,15 +66,3 @@ test-suite test , tasty-hedgehog ^>= 1.0.0.1 , tasty-hunit >= 0.10 && <1 , text - -benchmark benchmarks - import: haskell - hs-source-dirs: bench - type: exitcode-stdio-1.0 - main-is: Main.hs - ghc-options: -threaded -static -rtsopts - build-depends: base - , bytestring ^>= 0.10.8.2 - , semantic-tags - , semantic-source - , gauge ^>= 0.2.5