Make clangd configuration user-controllable

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Execution
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      This adds support for a (git-ignored) configuration file, `.vscode/clangd.env`, where variables can be set in an individual developer's environment to either remove the resource limits on clangd entirely, or to adjust the limits as needed. As can be seen with the value descriptions below, leaving these defaults can highly protect developer system resources, and removing them entirely or increasing the limits can make an extreme performance improvement on clangd indexing, reducing time to index the repository from days to minutes.

      These variables are:
      ```
      CLANGD_NO_LIMITS - default 0. Setting to 1 disables systemd limits entirely.
      CLANGD_JOBS - default 4. Controls clangd parallelism via -j=<n> argument.

      1. systemd limit controls
        CLANGD_MEMORY_HIGH - default 4G. Controls memory throttling limit.
        CLANGD_MEMORY_MAX - default 8G. Controls memory absolute limit.
        CLANGD_MEMORY_SWAP_MAX - default 16G. Controls swap memory absolute limit.
        CLANGD_IO_WEIGHT - default 10. Controls I/O bandwidth with a weight value between 1 and 10000; not setting defaults to 100.
        CLANGD_IO_SCHEDULING_CLASS - default idle. Controls I/O scheduling class with a value of realtime, best-effort or idle; not setting defaults to best-effort.
        CLANGD_IO_SCHEDULING_PRIORITY - default 7. Controls I/O scheduling priority with a value between 1 (highest) and 7 (lowest); not setting defaults to 4 with best-effort.
        ```

            Assignee:
            Alex Sarkesian
            Reporter:
            Alex Sarkesian
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: