diff options
author | alexwl <alexey.a.kiryushin@gmail.com> | 2019-01-23 17:18:29 +0300 |
---|---|---|
committer | alexwl <alexey.a.kiryushin@gmail.com> | 2019-01-23 17:18:29 +0300 |
commit | 0f84e1f004e29663b51e550d5bf7abe6188d3dca (patch) | |
tree | bc186f07c139029f2713ae967bb4b1e8b403fe9d /haskell-code-explorer.cabal | |
parent | 2713b196d3af4e7d0bb42b9ba951ae3cb5cf5873 (diff) |
Optimize memory usage of haskell-code-server
This commit adds an option to create an on-disk key-value store that contains all the data from PackageInfo of each indexed package in a queriable form. The store can be used by haskell-code-server to respond to API requests. The main benefit of using the store, compared to deserializing and loading PackageInfo of each package into memory, is reduced memory usage (approximately 7 times for a set of Haskell packages).
The key-value store on disk consists of two files: 'index' and 'values'. 'index' is a small file that contains a map from strings to locations in a 'values' file. 'index' file should be deserialized and loaded into memory. 'values' is a large file that contains serialized Haskell data structures. 'values' file can be either read directly (without deserializing) or memory-mapped.
Diffstat (limited to 'haskell-code-explorer.cabal')
-rw-r--r-- | haskell-code-explorer.cabal | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/haskell-code-explorer.cabal b/haskell-code-explorer.cabal index 9ecfcd6..4a58af3 100644 --- a/haskell-code-explorer.cabal +++ b/haskell-code-explorer.cabal @@ -76,7 +76,7 @@ executable haskell-code-server main-is: Server.hs ghc-options: -Wall -O2 -rtsopts -funbox-strict-fields -threaded hs-source-dirs: app,src - other-modules: HaskellCodeExplorer.Types + other-modules: HaskellCodeExplorer.Types, Store build-depends: IntervalMap , aeson , base @@ -110,6 +110,7 @@ executable haskell-code-server , data-default , pagination , file-embed + , mmap if impl(ghc >= 8.4.3) build-depends: ghc-compact |