[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Release plans

From: Thien-Thi Nguyen
Subject: Re: Release plans
Date: Sat, 30 Aug 2008 21:51:01 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

() Stefan Monnier <address@hidden>
() Fri, 29 Aug 2008 16:20:09 -0400

   I'm not sure I understand what you mean.  In the case of something like
   Semantic, if parsing in Elisp is too expensive or if you want to use
   some existing C code to do the parsing, the bottleneck you'll have to
   handle is that the external process can't directly access the buffer's

In the common case, that text is a file on the filesystem (which the
subprocess can access independently).  I would design things so that the
subprocess persists for the Emacs session and maintains its own state,
such as various project-specific symbol tables and a copy of the buffer.
Commands from Emacs would be along the lines of "sync-with-file",
"query-symbol", "query-parse-state", and so forth.  Results from the
query-FOO commands should typically be very low bandwidth.

So no, i don't think the bottleneck would be the buffer access (for this
design), because the subprocess does not really need to access the buffer.
Changes to the buffer that have not yet hit the filesystem can be
communicated by publishing some portion of `buffer-undo-list' (which is
also relatively lightweight).

   and it can be very costly to pass that text to the subprocess and
   then process the returned value (which may look like a list of text
   properties to add to various parts of the text).


   A DLL could be significantly more efficient.  The difference can be as
   large as "on-the-fly" vs "batch".

...i suppose i'll have to agree that all these "could be" scenarios are
possible.  My view is that given the requirement of external symbol tables
(and other state), the biggest win for both performance and maintainability
is to go asynchronous.  If you want async from a subprocess, no worries,
but if you want async in-process, you need to either design (and debug and
maintain) "ethreads", or make Emacs play nice w/ pthreads or quickthreads
or phase-of-the-moon-threads or whathaveyou.  Then, you need to make sure
every visitor treats your program counter w/ the respect it deserves.
That's a lot of thankless and brutish police work.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]