unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: David Engster <deng@randomsample.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org, atamariya@gmail.com
Subject: Re: Semantic font-lock for Java
Date: Fri, 24 Jan 2020 21:38:07 +0100	[thread overview]
Message-ID: <87pnf8y4i8.fsf@randomsample> (raw)
In-Reply-To: <83iml0r5fw.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 24 Jan 2020 21:59:47 +0200")

>> From: David Engster <deng@randomsample.de>
>> Cc: Anand Tamariya <atamariya@gmail.com>,  emacs-devel@gnu.org
>> Date: Fri, 24 Jan 2020 18:00:02 +0100
>> 
>> > So we are talking about a 17% slow-down?  Not bad.
>> 
>> Yes, but to be fair, this does not include the initial parsing by
>> Semantic/Wisent/Bovine. This is usually done for the whole buffer when
>> Emacs is idle, and not during scrolling.
>
> So what happens when the file is visited and its first window-full is
> displayed?

I can't speak for how Anand has configured his Emacs, but the default is
(was?)  that the file is displayed first and after a short idle time (1
second?)  Semantic will start parsing the current buffer. If you use
Semantic's "decoration mode", overlays will be put on the parsed
structures. So my guess is the scroll benchmark is simply 17% slower
because there are more overlays in the buffer, not because of actual
parsing.

The parsing itself is pretty slow, unsurprsingly, since it is all in
ELisp. Eric has invested a ton of time to make it bearable, mostly
through aggressive caching and by making the parser as "lazy" as
possible (only parse what is currently needed and do the rest when Emacs
is idle).

That being said, I of course welcome Anand's work which shows that we
already have a framework to store and query ASTs in Emacs. If we want to
incorporate something like Treesitter, one should at least take a look
at it.

-David



  reply	other threads:[~2020-01-24 20:38 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-21 11:39 Semantic font-lock for Java Anand Tamariya
2020-01-21 15:41 ` Eli Zaretskii
2020-01-21 15:48   ` Eli Zaretskii
2020-01-22  5:13   ` Anand Tamariya
2020-01-22 17:25     ` Eli Zaretskii
2020-01-23  5:36       ` Anand Tamariya
2020-01-24  7:40         ` Eli Zaretskii
2020-01-24 16:15           ` Anand Tamariya
2020-01-24 16:20             ` Eli Zaretskii
2020-01-24 17:00               ` David Engster
2020-01-24 19:59                 ` Eli Zaretskii
2020-01-24 20:38                   ` David Engster [this message]
2020-01-28 15:50                     ` Anand Tamariya
2020-01-28 17:21                       ` David Engster
2020-01-28 17:50                         ` Eli Zaretskii
2020-01-29  5:14                         ` Anand Tamariya
2020-02-03  3:24                           ` Eric Ludlam
2020-01-28 19:43         ` Alan Mackenzie
2020-01-29  5:44           ` Anand Tamariya
2020-01-22  5:52 ` Anand Tamariya

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=87pnf8y4i8.fsf@randomsample \
    --to=deng@randomsample.de \
    --cc=atamariya@gmail.com \
    --cc=eliz@gnu.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).