[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [SPAM UNSURE] Emacs crashes when writting JavaScript
From: |
Stephen Leake |
Subject: |
Re: [SPAM UNSURE] Emacs crashes when writting JavaScript |
Date: |
Mon, 23 Sep 2019 11:12:16 -0700 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.2 (windows-nt) |
Jackson Ray Hamilton <address@hidden> writes:
> Emacs’ JSX support is relatively new and could probably be optimized
> to perform better at scale. I noticed similar slowdowns with files
> containing 300+ lines of JSX.
ada-mode was also slow on large files (I have customers with 5k, 7k line
files!). The solution was to support partial parsing.
For example, when indenting, use regexp search to find a reasonable
start point (block start, function start), and assume it is indenting
properly. Then parse from there for one complete grammar production.
This requires modifying the grammar; lower level productions (for
statement, declaration) must be a complete grammmar parse (normally only
a complete file/package).
That doesn't work for some operations. For example, to jump to the
"context clause" in Ada ("with" statements at the start of the file;
like Java "import" statements), requires parsing the whole file.
On the whole, incremental parsing makes ada-mode useable on large files.
--
-- Stephe