Open kokobd opened 2 years ago
Thus, cabal solver fails if I add filepath ^>= 1.4.100.0 to a project that depends on ghc, which then depends on ghci.
Oh bummer. Well, if we really want to, it should be ok to embed OsPath
and combinators in a filepath-compat
package.
https://gitlab.haskell.org/ghc/ghc/-/issues/21887#note_443922
It may be possible to provide updated GHC releases that include new filepath. But this is still in discussion.
I don't know why, but the overall memory usage decreased from 1.5G to 700M
The data is collected by launching haskell-language-server
from the command line in the HLS source repo with profiling RTS options enabled.
@kokobd you mean between String and OsPath?
@kokobd you mean between String and OsPath?
@hasufell Yes. But when loading HLS executable into VSCode, I no longer witness such a big difference. I'm still investigating the reason.
Can you run cabal bench ghcide and share the contents of the ghcide/bench-results folder minus the binaries ?
cabal bench ghcide
is failing with master & ghc 9.2.3. Verified by creating a fresh new Gitpod workspace from master.
I'll take a look, but in the meantime CI shows that it works fine on 8.10.7. Would you be able to run it there?
EDIT: nevermind, I see that 8.10.7 won't do EDIT2: #3069 should help
Ran the edit benchmark on Cabal 3.6.3.0, results seem quite promising:
Next steps:
lsp
and lsp-types
in HLS to 1.5. It has some breaking changes.filepath-compat
to support older versions of GHC (currently it only supports ghc 9.2.3), or release GHC minor versions with new filepath
package. Support of some old GHC might need to be dropped. See: https://gitlab.haskell.org/ghc/ghc/-/issues/21887Real OsPath
will only be available since GHC 9.6. Instead, I use ShortByteString
within NormalizedFilePath
. The result is still very promising.
Soon, we will benefit from the performance improvement with all versions of GHC supported by HLS.
Next steps:
I think this is mostly done. Was there more to do?
I haven't looked at it, but I wonder how you do file operations etc. I'm guessing you convert back to filepath somewhere? In that case the conversion is not complete
It looks like the situation is:
lsp
is set up for OsPath
OsPath
everywhereSo in ten years, I guess?
Two major GHC versions, so yeah, a while. Or I guess if someone is keen and wants to do it with conditional logic they could do!
We have a better alternative to FilePath now. See: https://hasufell.github.io/posts/2022-06-29-fixing-haskell-filepaths.html
What we should do:
NormalizedFilePath
toNormalizedOsPath
after the issue in lsp to support OsPath https://github.com/haskell/lsp/issues/445 is solved. Profiling it to make sure the performance improves.FilePath
toOsPath
However, this can not be done until
ghc-9.6
is released (ships the newfilepath
library), or all ghc shipped libraries are available on Hackage.