From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Jorge Javier Araya Navarro Newsgroups: gmane.emacs.devel Subject: Re: Emacs crashes when writting JavaScript Date: Mon, 23 Sep 2019 12:30:52 -0600 Message-ID: <87pnjqoof7.fsf@yahoo.com.mx> References: <87v9tqcd57.fsf@yahoo.com.mx> <4d136a64-b3f4-24e4-1f28-c22a59468295@jacksonrayhamilton.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="213205"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: mu4e 1.3.4; emacs 27.0.50 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 23 20:31:25 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iCT7M-000tLy-Mo for ged-emacs-devel@m.gmane.org; Mon, 23 Sep 2019 20:31:24 +0200 Original-Received: from localhost ([::1]:60826 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCT7L-000799-E3 for ged-emacs-devel@m.gmane.org; Mon, 23 Sep 2019 14:31:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50231) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCT72-000780-Eh for emacs-devel@gnu.org; Mon, 23 Sep 2019 14:31:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCT70-0000Ys-54 for emacs-devel@gnu.org; Mon, 23 Sep 2019 14:31:04 -0400 Original-Received: from sonic307-2.consmr.mail.bf2.yahoo.com ([74.6.134.41]:35946) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iCT6y-0000We-9D for emacs-devel@gnu.org; Mon, 23 Sep 2019 14:31:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com.mx; s=s2048; t=1569263456; bh=OHmLNFZ3Oald0PfSksasbqt1PWuoVPwU3qkPJkimXro=; h=References:From:To:Subject:Date:From:Subject; b=dXcI8yCW5ESE4erkuwoHRsu1HIWZDrBsObN3JamZ6Juj9uaSatGpsptzotJMW7eOLDJE2U181+fzSSdCwykXpB2LSttznUPfVNxkHrIG8R8W4T6JNmH79o1DSKIjg9o9RJo33wVCDpjal+2f53A2iC027xFnvO7yjjySSBv28E2C526p2FlRwuBzdlUQqgeiuPVeZ3nUP6xh8HyTSL5iQT9t8dnOhQq2rZi6R9eCnq9ant1rl8KW20awQRSJEqJ2MSJnuHk1kEgFxdg+3VHVJUbyVqPwLSIab7QBuxVMXEj3YbgG5MmxbvrdeQ9vT6z0Q/py5HatEjoj0ivvQIwQQg== X-YMail-OSG: sNjdPl8VM1mqrJ6imhqetfiwcelSFZXs8JFrio7ZoBnoTf5yWJfE_6Y6IjCljhT 9rRgYzv4U8K6AdWyRiaFEl8cGkEa86.JN3bHpsgw4p0u1N3eLRBzKYJ2PHDv.wz7qbCgMTnb_RO1 NIZqd3i5EL6N90ZYqhauodRiD0Ah1.HtOs_vHopbdaDqUAp5OKgbs13NKE5l_RbM4ofY0q48BYA8 vOelnlLDmDPoBF1oYMdxulUVq_k7Bkx63e.yPoQ913Kky2PSOF79h_CYbPLYHU30E6TJ5f6meLBA Rny1XI1A2s9W8ocNOhyAb6eOtiJkuK3n_jgmnHw7imCLC..INiWqbpex.V_VXJM8qDhI5k0y0KkG zLqrZnI66VlCsamvYt8CToSy2CBoTMAI8QwljLJ.f8.26ouOugvN6HkUnIr1frSyAzh9.tYr4OjE nFrvEIWHHd5kr1GqUBH6c2knxdBDZC7WSyNfkzVQO4ORGHmFwG3fdc9CtiJ_OjYvtJMWK5Z3GSr0 xJhrzTy4FMi5O0qITwA4Ik8c61B7WMFN51SVZfJTUwDO7RNbTGY.OFI.t689bNaFzo6Xw_VWrcEN l1MVR3j5KMAWxhrGZCWTIRyr.c.hG9hrejMahl7J4z1TlFpBTGO1YWGbDl3wWmsgdf1tQJ5mE_BB Appp.u5cpvialsffa0BhBacY6limql41oK2HURIfhFbxmdTvtwVerU7m5GYOWQe6IEl1chwdAuGO wZqW7QpPGmKsRj2cLod9DZpG4AQw6LNx.mpHTX_YMUEY_FCo85W9Ls3zAGMT8GzsPznBQKe2gMPZ dBKk1FK4JuBxLmMc3.lWaa3hXddfKuGl5VdEs.SU5A Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.bf2.yahoo.com with HTTP; Mon, 23 Sep 2019 18:30:56 +0000 Original-Received: by smtp414.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID c8024094ffd59a14ee6ccb76beeeac0a; Mon, 23 Sep 2019 18:30:54 +0000 (UTC) In-reply-to: <4d136a64-b3f4-24e4-1f28-c22a59468295@jacksonrayhamilton.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 74.6.134.41 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:240270 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable El domingo 22 de septiembre del 2019 a las 1850 horas, Jackson Ray Hamilton= escribi=C3=B3: > Hola Jorge, > > Emacs=E2=80=99 JSX support is relatively new and could probably be optimi= zed > to perform better at scale. I noticed similar slowdowns with files > containing 300+ lines of JSX. > > Before I contributed the JSX support code to Emacs, I used > (elp-instrument-package "js-") and (elp-results) to identify choke > points during editing. I felt like I was able to slightly improve > performance for large files, going from =E2=80=9Cunusable=E2=80=9D to mer= ely > =E2=80=9Cfrustrating.=E2=80=9D > > If you are familiar with Emacs Lisp and feel compelled to make things > stabler and faster, perhaps you can find some time to benchmark and > experiment in lisp/progmodes/js.el. Otherwise, please open a bug report. > > Some tips if you decide to help: you mentioned an AST, but there isn=E2= =80=99t > one. Parsing starts in js-syntax-propertize. Years ago, Sebastian > Wiesner wrote some blog articles explaining how syntax highlighting > worked in Emacs, but he=E2=80=99s since removed those posts from his blog= and > they aren=E2=80=99t available on Internet Archive. Maybe he will provide = you > with the articles if you ask him for: > > * 2014, Mar 11 Overview of Emacs Font Locking > * 2014, Mar 12 Syntactic fontification in Emacs > * 2014, Mar 26 Search-based fontification with keywords > * 2014, Jun 16 Advanced syntactic fontification > > Also, maybe you could separate your JSX code into smaller modules. > That will make it easier for tools like Emacs, prettifiers, and > linters to process your code. Even though the code can probably be > optimized, since we care about accuracy parsing time will ultimately > be gated by file length regardless. Smaller modules are also > consistent with some programmers=E2=80=99 expectations for high quality c= ode; > they are more likely to be below length thresholds permitting easy > comprehension. > > Jackson Hey, Jackson! Thanks for the pointers, I'm absolutely interested in making the JavaScript= (and JSX) support in Emacs better. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEORmQ/HnKp2aOAjuqtplkhLhPbZMFAl2JD1wACgkQtplkhLhP bZPHhw/8CFxS1nLBlHk6AGlkkqR4i9tUJehM2SyY2IXo/e3LgaYI2GMej1XJpckj WQmxNr+YayVn7aEp/Nbb+rq0p5YyOy8Z7QBLCsnB55eUMTYdUhf1N9uGqkyRqAnA 7rj4pUeKT0cQjRUiNBKBdub+jLz1NZs0qr9/PRS8W/EEJbFrVRv3rk1WqlABxFUO /QP0H9xDeZdfTkEDiPEJcBPJ+3VYkSNWYqsbBgD0pfAFmjespgGvRbXAlYT9k0aY 0+6FhCpcxhTOwxWZj7T/Q6+D8JDDWazU7LVMJsfPZnYQ35w+ewuLqQKe3Bo6sV7z ka+YcOyGRXpZ6yE7qLkBLBP8m7A555R7bxBC9tgJXDqQLF2826CC+CpVcc3/dfcB uDANfXZEnyFoRbOmD9nr239wnuXwAQG1a8lCq0LHe3N0KxTqtBqBjCsWalGNZaWU iKJzZeEw3m7nnBVTUb04izsHO9RexSmuNE0YtpijbJtjnWgbkpUrpqiH4wPYzDtS W8uAnyBxsGcRpWhafX3yRmmOYuAjycENTsR+uwBs4LWY2YokmPr75Y43c25WJ8wD /wqST2BVUxs1gQfQ8Z7eYl7Ok1ivB/Q3HIvtSbudkGlhd07m4WaNHYoxLhKHvW57 /vCO2635gyKo7qGXzpTI7f6LplZrtAopqwtrjN4fuANHwSCHbAw= =fudH -----END PGP SIGNATURE----- --=-=-=--