mirror of
https://github.com/github/semantic.git
synced 2024-11-26 09:07:39 +03:00
Just use top level benchmarks
This commit is contained in:
parent
fe69bdf5d8
commit
f8d2a2d617
@ -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)))
|
|
@ -66,15 +66,3 @@ test-suite test
|
|||||||
, tasty-hedgehog ^>= 1.0.0.1
|
, tasty-hedgehog ^>= 1.0.0.1
|
||||||
, tasty-hunit >= 0.10 && <1
|
, tasty-hunit >= 0.10 && <1
|
||||||
, text
|
, 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
|
|
||||||
|
Loading…
Reference in New Issue
Block a user