Compilers only do one file at a time, but an LSP needs to parse all the files.
Also, an LSP needs to update incrementally when you edit the file, not just when you compile.
Also, an LSP needs to update incrementally when you edit the file, not just when you compile.