php-language-server: Indexing became extremely slow

After recent changes indexing performance decreased and memory consumption increased extremely. After indexing 3k-4k files slow down is more visible.

Result for magento (24k files) project: All PHP files parsed in 2904 seconds. 6123 MiB allocated. Previous those values were about 100s and 600MiB.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 25 (25 by maintainers)

Most upvoted comments

$content is currently kept in memory in addition to the AST. Which means we basically keep all file contents in memory. It is only used for formatting, so I propose we re-read the content on formatting request.

File content should be kept in memory only for those files, which the language server received a didOpen notification for. And discarded on a didClose notification. The language server should not read the content from the file system for files that are currently opened in the editor.