Experiments

haskell-language-server-2.9.0.0: LSP server for GHC

Safe Haskell | None
Language | GHC2021

Experiments

Synopsis

- data Bench = Bench {
  - name :: !String
  - enabled :: !Bool
  - samples :: !Natural
  - benchSetup :: [DocumentPositions] -> Session ()
  - experiment :: Experiment
  }
- data BenchRun = BenchRun {
  - startup :: !Seconds
  - runSetup :: !Seconds
  - runExperiment :: !Seconds
  - userWaits :: !Seconds
  - delayedWork :: !Seconds
  - firstResponse :: !Seconds
  - firstResponseDelayed :: !Seconds
  - rulesBuilt :: !Int
  - rulesChanged :: !Int
  - rulesVisited :: !Int
  - rulesTotal :: !Int
  - edgesTotal :: !Int
  - rebuildsTotal :: !Int
  - success :: !Bool
  }
- data Config = Config {
  - verbosity :: !Verbosity
  - shakeProfiling :: !(Maybe FilePath)
  - otMemoryProfiling :: !(Maybe FilePath)
  - outputCSV :: !FilePath
  - buildTool :: !CabalStack
  - ghcideOptions :: ![String]
  - matches :: ![String]
  - repetitions :: Maybe Natural
  - ghcide :: FilePath
  - timeoutLsp :: Int
  - example :: Example
  - lspConfig :: Bool
  }
- data Verbosity
  - = Quiet
  - | Normal
  - | All
- data CabalStack
  - = Cabal
  - | Stack
- data SetupResult = SetupResult {
  - runBenchmarks :: [Bench] -> IO ()
  - benchDir :: FilePath
  - cleanUp :: IO ()
  }
- data Example = Example {
  - exampleName :: !String
  - exampleDetails :: ExampleDetails
  - exampleModules :: [FilePath]
  - exampleExtraArgs :: [String]
  }
- experiments :: HasConfig => [Bench]
- configP :: Parser Config
- defConfig :: Config
- output :: (MonadIO m, HasConfig) => String -> m ()
- setup :: HasConfig => IO SetupResult
- runBench :: HasConfig => (Session BenchRun -> IO BenchRun) -> Bench -> IO BenchRun
- exampleToOptions :: Example -> [String] -> [String]

# Documentation

data Bench #

Constructors

Bench |
Fields name :: !String enabled :: !Bool samples :: !Natural benchSetup :: [DocumentPositions] -> Session () experiment :: Experiment

data BenchRun #

Constructors

BenchRun |
Fields startup :: !Seconds runSetup :: !Seconds runExperiment :: !Seconds userWaits :: !Seconds delayedWork :: !Seconds firstResponse :: !Seconds firstResponseDelayed :: !Seconds rulesBuilt :: !Int rulesChanged :: !Int rulesVisited :: !Int rulesTotal :: !Int edgesTotal :: !Int rebuildsTotal :: !Int success :: !Bool

data Config #

Constructors

Config |
Fields verbosity :: !Verbosity shakeProfiling :: !(Maybe FilePath) otMemoryProfiling :: !(Maybe FilePath) outputCSV :: !FilePath buildTool :: !CabalStack ghcideOptions :: ![String] matches :: ![String] repetitions :: Maybe Natural ghcide :: FilePath timeoutLsp :: Int example :: Example lspConfig :: Bool

#### Instances

Instances details

Show Config # |
Instance details Defined in Experiments.Types Methods showsPrec :: Int -> Config -> ShowS # show :: Config -> String # showList :: [Config] -> ShowS #
Eq Config # |
Instance details Defined in Experiments.Types Methods (==) :: Config -> Config -> Bool # (/=) :: Config -> Config -> Bool #

data Verbosity #

Constructors

Quiet |
Normal |
All |

#### Instances

Instances details

Show Verbosity # |
Instance details Defined in Experiments.Types Methods showsPrec :: Int -> Verbosity -> ShowS # show :: Verbosity -> String # showList :: [Verbosity] -> ShowS #
Eq Verbosity # |
Instance details Defined in Experiments.Types Methods (==) :: Verbosity -> Verbosity -> Bool # (/=) :: Verbosity -> Verbosity -> Bool #

data CabalStack #

Constructors

Cabal |
Stack |

#### Instances

Instances details

Show CabalStack # |
Instance details Defined in Experiments.Types Methods showsPrec :: Int -> CabalStack -> ShowS # show :: CabalStack -> String # showList :: [CabalStack] -> ShowS #
Eq CabalStack # |
Instance details Defined in Experiments.Types Methods (==) :: CabalStack -> CabalStack -> Bool # (/=) :: CabalStack -> CabalStack -> Bool #

data SetupResult #

Constructors

SetupResult |
Fields runBenchmarks :: [Bench] -> IO () benchDir :: FilePath Path to the setup benchmark example cleanUp :: IO ()

data Example #

Constructors

Example |
Fields exampleName :: !String exampleDetails :: ExampleDetails exampleModules :: [FilePath] exampleExtraArgs :: [String]

#### Instances

Instances details

FromJSON Example # |
Instance details Defined in Experiments.Types Methods parseJSON :: Value -> Parser Example # parseJSONList :: Value -> Parser [Example] # omittedField :: Maybe Example #
Binary Example # |
Instance details Defined in Experiments.Types Methods put :: Example -> Put # get :: Get Example # putList :: [Example] -> Put #
NFData Example # |
Instance details Defined in Experiments.Types Methods rnf :: Example -> () #
Generic Example # |
Instance details Defined in Experiments.Types Associated Types
type Rep Example |
Instance details Defined in Experiments.Types type Rep Example = D1 ('MetaData "Example" "Experiments.Types" "haskell-language-server-2.9.0.0-12YGKAbvAnyEQ6CCEAG9bX-ghcide-bench-lib" 'False) (C1 ('MetaCons "Example" 'PrefixI 'True) ((S1 ('MetaSel ('Just "exampleName") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 String) :*: S1 ('MetaSel ('Just "exampleDetails") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ExampleDetails)) :*: (S1 ('MetaSel ('Just "exampleModules") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [FilePath]) :*: S1 ('MetaSel ('Just "exampleExtraArgs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [String]))))
Methods from :: Example -> Rep Example x # to :: Rep Example x -> Example #
Show Example # |
Instance details Defined in Experiments.Types Methods showsPrec :: Int -> Example -> ShowS # show :: Example -> String # showList :: [Example] -> ShowS #
Eq Example # |
Instance details Defined in Experiments.Types Methods (==) :: Example -> Example -> Bool # (/=) :: Example -> Example -> Bool #
Hashable Example # |
Instance details Defined in Experiments.Types Methods hashWithSalt :: Int -> Example -> Int # hash :: Example -> Int #
type Rep Example # |
Instance details Defined in Experiments.Types type Rep Example = D1 ('MetaData "Example" "Experiments.Types" "haskell-language-server-2.9.0.0-12YGKAbvAnyEQ6CCEAG9bX-ghcide-bench-lib" 'False) (C1 ('MetaCons "Example" 'PrefixI 'True) ((S1 ('MetaSel ('Just "exampleName") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 String) :*: S1 ('MetaSel ('Just "exampleDetails") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ExampleDetails)) :*: (S1 ('MetaSel ('Just "exampleModules") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [FilePath]) :*: S1 ('MetaSel ('Just "exampleExtraArgs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [String]))))

experiments :: HasConfig => [Bench] #

configP :: Parser Config #

defConfig :: Config #

output :: (MonadIO m, HasConfig) => String -> m () #

setup :: HasConfig => IO SetupResult #

Setup the benchmark we need to create a hie.yaml file for the examples or the hie.yaml file would be searched in the parent directories recursively implicit-hie is error prone for the example test `lsp-types-2.1.1.0` we are using the simpleCabalCradleContent for the hie.yaml file instead. it works if we have cabal > 3.2.

runBench :: HasConfig => (Session BenchRun -> IO BenchRun) -> Bench -> IO BenchRun #

exampleToOptions :: Example -> [String] -> [String] #