unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
To: emacs-devel <emacs-devel@gnu.org>
Subject: Re: [SPAM UNSURE] Emacs crashes when writting JavaScript
Date: Mon, 23 Sep 2019 11:12:16 -0700	[thread overview]
Message-ID: <861rw6rif3.fsf@stephe-leake.org> (raw)
In-Reply-To: <4d136a64-b3f4-24e4-1f28-c22a59468295@jacksonrayhamilton.com> (Jackson Ray Hamilton's message of "Sun, 22 Sep 2019 17:50:29 -0700")

Jackson Ray Hamilton <jackson@jacksonrayhamilton.com> 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



  parent reply	other threads:[~2019-09-23 18:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87v9tqcd57.fsf.ref@yahoo.com.mx>
2019-09-18  6:49 ` Emacs crashes when writting JavaScript Jorge Javier Araya Navarro
2019-09-18 12:18   ` Eli Zaretskii
2019-09-23  0:50   ` Jackson Ray Hamilton
2019-09-23 13:29     ` Dmitry Gutov
2019-09-23 18:12     ` Stephen Leake [this message]
2019-09-23 18:30     ` Jorge Javier Araya Navarro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=861rw6rif3.fsf@stephe-leake.org \
    --to=stephen_leake@stephe-leake.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).