Repository navigation
getDocsBatch for bulk processing - #2371
Draft
Anton-Latukha wants to merge 1 commit into
Draft
Anton-Latukha wants to merge 1 commit into
Anton-Latukha wants to merge 1 commit into
Conversation
Anton-Latukha
force-pushed
the
2021-11-19-bulk-getDocsBatch
branch
2 times, most recently
from
November 19, 2021 18:46
ab947a3 to
38463da
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Anton-Latukha
force-pushed
the
2021-11-19-bulk-getDocsBatch
branch
from
November 19, 2021 21:25
1308553 to
1d65815
Compare
This comment has been minimized.
This comment has been minimized.
Anton-Latukha
force-pushed
the
2021-11-19-bulk-getDocsBatch
branch
from
November 19, 2021 21:31
1d65815 to
4353c0d
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Anton-Latukha
added a commit
to Anton-Latukha/haskell-language-server
that referenced
this pull request
Nov 26, 2021
`getDocsBatch` cuurently (& before) used only for single name retrieval function. Use of it is in `Documentation` module `getDocumentationTryGhc` where it wraps arg into singleton & gives to `getDocsBatch` & then recieves a Map with 1 entry & unsafely "lookups" doc in it. This work is to supply the proper single name retrieval-optimized version to stop that `getDocsBatch` there. & further ideally `getDocumentationTryGhc` uses single-retrieval & `getDocumentationsTryGhc` uses a batch mode & batch mode gets optimized along the lines of: haskell#2371
Anton-Latukha
added a commit
to Anton-Latukha/haskell-language-server
that referenced
this pull request
Nov 26, 2021
`getDocsBatch` cuurently (& before) used only for single name retrieval function. Use of it is in `Documentation` module `getDocumentationTryGhc` where it wraps arg into singleton & gives to `getDocsBatch` & then recieves a Map with 1 entry & unsafely "lookups" doc in it. This work is to supply the proper single name retrieval-optimized version to stop that `getDocsBatch` there. & further ideally `getDocumentationTryGhc` uses single-retrieval & `getDocumentationsTryGhc` uses a batch mode & batch mode gets optimized along the lines of: haskell#2371
Anton-Latukha
added a commit
to Anton-Latukha/haskell-language-server
that referenced
this pull request
Nov 27, 2021
`getDocsBatch` cuurently (& before) used only for single name retrieval function. Use of it is in `Documentation` module `getDocumentationTryGhc` where it wraps arg into singleton & gives to `getDocsBatch` & then recieves a Map with 1 entry & unsafely "lookups" doc in it. This work is to supply the proper single name retrieval-optimized version to stop that `getDocsBatch` there. & further ideally `getDocumentationTryGhc` uses single-retrieval & `getDocumentationsTryGhc` uses a batch mode & batch mode gets optimized along the lines of: haskell#2371
Anton-Latukha
added a commit
to Anton-Latukha/haskell-language-server
that referenced
this pull request
Dec 12, 2021
`getDocsBatch` cuurently (& before) used only for single name retrieval function. Use of it is in `Documentation` module `getDocumentationTryGhc` where it wraps arg into singleton & gives to `getDocsBatch` & then recieves a Map with 1 entry & unsafely "lookups" doc in it. This work is to supply the proper single name retrieval-optimized version to stop that `getDocsBatch` there. & further ideally `getDocumentationTryGhc` uses single-retrieval & `getDocumentationsTryGhc` uses a batch mode & batch mode gets optimized along the lines of: haskell#2371
Anton-Latukha
added a commit
to Anton-Latukha/haskell-language-server
that referenced
this pull request
Dec 15, 2021
`getDocsBatch` cuurently (& before) used only for single name retrieval function. Use of it is in `Documentation` module `getDocumentationTryGhc` where it wraps arg into singleton & gives to `getDocsBatch` & then recieves a Map with 1 entry & unsafely "lookups" doc in it. This work is to supply the proper single name retrieval-optimized version to stop that `getDocsBatch` there. & further ideally `getDocumentationTryGhc` uses single-retrieval & `getDocumentationsTryGhc` uses a batch mode & batch mode gets optimized along the lines of: haskell#2371
Anton-Latukha
commented
Dec 19, 2021
| where | ||
| throwErrors = liftIO . throwIO . mkSrcErr | ||
| compiled n = | ||
| ((_warns,errs), res) <- initTc hsc_env HsSrcFile False _mod fakeSpan $ Map.fromList <$> traverse undefined undefined |
Collaborator
Author
There was a problem hiding this comment.
I looked at the HLS code and you should probably rather use:
initIfaceLoad hsc_env (loadSysInterface "docs" module)
to load the interface rather than callinginitTc.
Then that will cache the loaded interface so you don't load it multiple times from disk.
Collaborator
Author
There was a problem hiding this comment.
(code currently is created so that it loads & opens interfaces once, but if I understand it right - the mentioned method caches interfaces between function runs).
This was referenced Dec 20, 2021
Merged
Anton-Latukha
added a commit
to Anton-Latukha/haskell-language-server
that referenced
this pull request
Dec 24, 2021
`getDocsBatch` cuurently (& before) used only for single name retrieval function. Use of it is in `Documentation` module `getDocumentationTryGhc` where it wraps arg into singleton & gives to `getDocsBatch` & then recieves a Map with 1 entry & unsafely "lookups" doc in it. This work is to supply the proper single name retrieval-optimized version to stop that `getDocsBatch` there. & further ideally `getDocumentationTryGhc` uses single-retrieval & `getDocumentationsTryGhc` uses a batch mode & batch mode gets optimized along the lines of: haskell#2371
Anton-Latukha
force-pushed
the
2021-11-19-bulk-getDocsBatch
branch
from
December 24, 2021 11:13
4353c0d to
4413a0f
Compare
Anton-Latukha
added a commit
to Anton-Latukha/haskell-language-server
that referenced
this pull request
Dec 25, 2021
`getDocsBatch` cuurently (& before) used only for single name retrieval function. Use of it is in `Documentation` module `getDocumentationTryGhc` where it wraps arg into singleton & gives to `getDocsBatch` & then recieves a Map with 1 entry & unsafely "lookups" doc in it. This work is to supply the proper single name retrieval-optimized version to stop that `getDocsBatch` there. & further ideally `getDocumentationTryGhc` uses single-retrieval & `getDocumentationsTryGhc` uses a batch mode & batch mode gets optimized along the lines of: haskell#2371
Anton-Latukha
added a commit
to Anton-Latukha/haskell-language-server
that referenced
this pull request
Dec 25, 2021
`getDocsBatch` cuurently (& before) used only for single name retrieval function. Use of it is in `Documentation` module `getDocumentationTryGhc` where it wraps arg into singleton & gives to `getDocsBatch` & then recieves a Map with 1 entry & unsafely "lookups" doc in it. This work is to supply the proper single name retrieval-optimized version to stop that `getDocsBatch` there. & further ideally `getDocumentationTryGhc` uses single-retrieval & `getDocumentationsTryGhc` uses a batch mode & batch mode gets optimized along the lines of: haskell#2371
Anton-Latukha
added a commit
to Anton-Latukha/haskell-language-server
that referenced
this pull request
Dec 25, 2021
`getDocsBatch` cuurently (& before) used only for single name retrieval function. Use of it is in `Documentation` module `getDocumentationTryGhc` where it wraps arg into singleton & gives to `getDocsBatch` & then recieves a Map with 1 entry & unsafely "lookups" doc in it. This work is to supply the proper single name retrieval-optimized version to stop that `getDocsBatch` there. & further ideally `getDocumentationTryGhc` uses single-retrieval & `getDocumentationsTryGhc` uses a batch mode & batch mode gets optimized along the lines of: haskell#2371
Anton-Latukha
added a commit
to Anton-Latukha/haskell-language-server
that referenced
this pull request
Dec 25, 2021
`getDocsBatch` cuurently (& before) used only for single name retrieval function. Use of it is in `Documentation` module `getDocumentationTryGhc` where it wraps arg into singleton & gives to `getDocsBatch` & then recieves a Map with 1 entry & unsafely "lookups" doc in it. This work is to supply the proper single name retrieval-optimized version to stop that `getDocsBatch` there. & further ideally `getDocumentationTryGhc` uses single-retrieval & `getDocumentationsTryGhc` uses a batch mode & batch mode gets optimized along the lines of: haskell#2371
Anton-Latukha
added a commit
to Anton-Latukha/haskell-language-server
that referenced
this pull request
Dec 25, 2021
`getDocsBatch` cuurently (& before) used only for single name retrieval function. Use of it is in `Documentation` module `getDocumentationTryGhc` where it wraps arg into singleton & gives to `getDocsBatch` & then recieves a Map with 1 entry & unsafely "lookups" doc in it. This work is to supply the proper single name retrieval-optimized version to stop that `getDocsBatch` there. & further ideally `getDocumentationTryGhc` uses single-retrieval & `getDocumentationsTryGhc` uses a batch mode & batch mode gets optimized along the lines of: haskell#2371
Anton-Latukha
added a commit
to Anton-Latukha/haskell-language-server
that referenced
this pull request
Dec 25, 2021
`getDocsBatch` cuurently (& before) used only for single name retrieval function. Use of it is in `Documentation` module `getDocumentationTryGhc` where it wraps arg into singleton & gives to `getDocsBatch` & then recieves a Map with 1 entry & unsafely "lookups" doc in it. This work is to supply the proper single name retrieval-optimized version to stop that `getDocsBatch` there. & further ideally `getDocumentationTryGhc` uses single-retrieval & `getDocumentationsTryGhc` uses a batch mode & batch mode gets optimized along the lines of: haskell#2371
Anton-Latukha
added a commit
to Anton-Latukha/haskell-language-server
that referenced
this pull request
Feb 1, 2022
`getDocsBatch` cuurently (& before) used only for single name retrieval function. Use of it is in `Documentation` module `getDocumentationTryGhc` where it wraps arg into singleton & gives to `getDocsBatch` & then recieves a Map with 1 entry & unsafely "lookups" doc in it. This work is to supply the proper single name retrieval-optimized version to stop that `getDocsBatch` there. & further ideally `getDocumentationTryGhc` uses single-retrieval & `getDocumentationsTryGhc` uses a batch mode & batch mode gets optimized along the lines of: haskell#2371
Anton-Latukha
added a commit
to Anton-Latukha/haskell-language-server
that referenced
this pull request
Feb 4, 2022
`getDocsBatch` cuurently (& before) used only for single name retrieval function. Use of it is in `Documentation` module `getDocumentationTryGhc` where it wraps arg into singleton & gives to `getDocsBatch` & then recieves a Map with 1 entry & unsafely "lookups" doc in it. This work is to supply the proper single name retrieval-optimized version to stop that `getDocsBatch` there. & further ideally `getDocumentationTryGhc` uses single-retrieval & `getDocumentationsTryGhc` uses a batch mode & batch mode gets optimized along the lines of: haskell#2371
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A branch from: #2349
Holds a relevant
getDocsBatchcode to make bulk requests.TODO:
error-> exception handling codeMaps be Strictfirsts can be flattened)Besides that - can not find the better-optimized version, I hope that
swap ... swap& tuple passing et al. optimizes/fuses away by GHC (which should).Also - after functor laws are applied - count the number of traverses through the
[]& weigh it for a number of batch requests.Currently in
masterprimary use ofgetDocsBatchis:getDocumentationTryGhcthat runs singleton element doc on:getDocumentationsTryGhcthat runsgetDocsBatchon singleton.getDocsBatchinternally has a modified (with removed interactive check) copy of GHCsgetDocs. If that internal 1-elem non-interactive function is needed - it probably needs to begetDocsNonInteractive& so be module scope.And then
getDocsBatchis designed for what it is intended - a bulk[Name]requests.Then I went further: if
getDocsBatchwould be used really in batch mode - why is to dogetDocsBatchongetDocsNonInteractive- that searches & loads module interface on each element:So, currently I do in
getDocsBatch:Load
[Name].For each
Nameget module it says being part of.Then group all
Namesby accordingModule:[(Module, [Name])].Then load module interface once & process through it in bulk [Name]s that are in that module.
For current way function is used (singleton retrieval) that would introduce
+ Csteps for retrieval (that may be specialized-away by the compiler).If HLS starts bulking retrieval from GHC interfaces based on [Name] - that would be optimal way.