caching and delta updates whenh working with many files

22 views
Skip to first unread message

Paul

unread,
Nov 25, 2014, 4:34:18 PM11/25/14
to tern...@googlegroups.com
Hi,

I'm looking into using tern in projects that consist of a lot of files (several thousand), which would take a long time to all load into tern. So I was wondering if it is possible to cache the interference result somehow and load that the next time the project is opened in the IDE, instead of having to load and process all the files again.

Secondly, if a file is edited, is it possible for tern to reprocess only that one updated file or better yet only the edited part of a file (in case of large files).

The reason I need (or at least think I need) to have all the files loaded is to make sure that on one side code completion works on types defined in other project files, but more importantly that a validator (like tern.lint) can properly raise warnings. My background is Eclipse, where an entire project or even workspace is "build" and generates builder markers. This process makes sure you get immediate feedback when refactoring the API of an object, without refactoring the places throughout your project where that API is being used (having all files loaded would also be needed to be able to do proper automated refactoring).

If I'm trying something impossible or missed something obvious, please correct me.

TIA,

Paul



Marijn Haverbeke

unread,
Dec 4, 2014, 6:09:26 AM12/4/14
to Paul, tern-dev
The condense tool can be used as a base for something like this, but
at the moment Tern itself does not help with automatically creating,
using, and updating such condensed definitions.

The Tern server does update only what needs to be updated, but it
periodically starts (in the background) a full re-analysis because the
type graph tends to deteriorate when it is patched up a bunch of
times. For giant projects, this will be expensive. For giant projects,
this is expensive. But for giant projects, the current approach is
problematic anyway, for memory-use reasons, so the approach you
outline would be better.

One approach would be to start a new project which wraps a Tern
server, exposing the same interface, but generating and using
condensed versions of files in the background. The tricky part is
figuring out which sets of files to treat as 'units' to be condensed
together. If you're using node-style packages, you could maybe use
these as units.

Best,
Marijn
> --
> You received this message because you are subscribed to the Google Groups
> "tern-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to tern-dev+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Angelo zerr

unread,
Dec 4, 2014, 7:34:53 AM12/4/14
to Marijn Haverbeke, Paul, tern-dev
Hi Paul, Marijn,

@Marijn : many thank's for your explanation.

@Paul : I have created an issue for tern.java to use condense at https://github.com/angelozerr/tern.java/issues/193

It should be very fanatstic if you could experiment it. Thank's!

Regard's Angelo
Reply all
Reply to author
Forward
0 new messages