vscode-haskell icon indicating copy to clipboard operation
vscode-haskell copied to clipboard

Add system requirements to the README

Open rainbyte opened this issue 1 year ago • 6 comments

Description

Is not clear how many system resources are officially required by this extension to work correctly on a reasonable sized project.

It has been said on Reddit that 4Gb of ram is not enough and that 16/32Gb is recommended.

Expected result

It would be useful to document in the README which are the officially supported setups to know beforehand if consumption issue is WONTFIX or BUG.

Example:

System requirements:

  • Disk: xxxGb or better
  • Memory: 16Gb minimum, 32Gb recommended
  • VSCode: version x.xx or better

Alternative

It would be even better if the extension itself could warn the user when it is running in an unsupported setup with not enough system resources.

Example:

Warning: Unsupported setup, less than 16Gb ram detected!

rainbyte avatar Sep 20 '22 13:09 rainbyte

This is tricky to do correctly, as the requirements depend on many factors.

For one, you may compile HLS with only the bare minimum of plugins. The resource consumption will be much, much smaller. Also, it depends on your project size. For experimentation on a single file, 4GB should be enough. However, developing on the GHC codebase will not work, it is unlikely that GHC itself can be compiled.

How do you think we should handle these cases? A generic "you need 16/32GB or RAM" will not really cut it, since you can still easily run out of memory, and you may also require much less RAM.

At last, you may also restrict the memory HLS uses by limiting the HEAP size via https://github.com/haskell/vscode-haskell#set-additional-environment-variables-for-the-server and GHCRTS.

fendor avatar Sep 20 '22 13:09 fendor

Hello @fendor, my motivation to create this issue was this Reddit discussion.

Public opinion variates, so it would be helpful to have some official statement from the project.

Could it be possible to measure resource consumption over representative projects from Hackage?

What does increase resource consumption the most? LoC, amount of modules, filesize?

Maybe the README could contain an estimated consumption based on a relevant parameter.

The idea is to provide at least some hint to the user

rainbyte avatar Sep 20 '22 23:09 rainbyte

There's no good way to provide hints. GHC and HLS are memory hogs. It entirely depends on the project and can range from said 4GB to more than 32 GB.

That's the only range we can meaningfully give. And I don't think it's very useful.

hasufell avatar Sep 21 '22 01:09 hasufell

I think that if 4Gb allows you to work with only a single file or two then it cannot be considered a "well supported setup".

Recommended setup should be able to handle most of the projects from Hackage without too much trouble.

Code repositories with millions LoC are special case, probably company projects. I suppose people working on those have more powerful machines available.

rainbyte avatar Sep 21 '22 15:09 rainbyte

Recommended setup should be able to handle most of the projects from Hackage without too much trouble.

Sorry, "most of the projects" is really a bad metrics too. There are humongous projects on hackage and a lot of small ones that may be fine with 4GB too, because the module size is small.

hasufell avatar Sep 21 '22 15:09 hasufell

While it feels like a nice idea, it is very difficult to get right, and I also think of limited use for the average user. However, if you conduct some experiments, I am happy to display the results on the README.

fendor avatar Sep 21 '22 16:09 fendor