Why is git so extremely much faster with files than IntelliJ?

With Git, if you have an arbitrarily huge project, you can change branches and git will have changed all the files in the blink of an eye (from the terminal).

Git detects when any random file changed, again in the blink of an eye.

It manages to keep track of everything you do to any arbitrary file of your huge project, and if you commit, it does it immediately, as if's nothing to git to keep track of 100000+ files and see which changed and even which content in it changed.

So apparently, doing this is possible on a linux file system.

Why does IntelliJ need 10 minutes of "scanning files" before it finally opens your project?

Thanks!

6 comments
Comment actions Permalink

Hello,

IJ is not just an editor, it is an IDE, i.e. it provides a big number of various factilities (navigation, show usages, quick docs, inspections, refactorings, quick fixes etc). It needs to prepare internal data structures to be able to perform that sort of tasks then. So, every time number of files is changed (e.g. switch to another branch) it needs to re-scan them and update internal state accordingly.

Denis

0
Comment actions Permalink

I feel your pain. I have the exact same issue. I work primarily on one related set of projects and use the command-line to switch between branches. After I switch branches I flip into IDEA to let it re-index the world and go do something else for a few minutes until it's done. The result is I try very hard _not_ to switch branches. I try to organize my work during the day to get everything done on one branch before moving to another. It's a real show-stopper. I don't have the answer for JetBrains. Maybe caching the indexes for a branch. Maybe less intrusive indexing or some increased knowledge of branch switches that make indexing smarter.

0
Comment actions Permalink

I can say that I use the following approach during working with different IJ (huge project) branches:

  1. Have one local repository per-branch, i.e. suppose that you have two branches - clone original repo two times into two different directories and then checkout to the target branches there;
  2. Configure necessary number of IJ distributions (equal to the number of target branches). Every distribution should have separate 'config' and 'system' directory;
  3. Start every distribution agains the corresponding branch and let it prepare the stuff (reindex, build caches etc);
  4. Every time I need to work with particular branch I start corresponding IJ instance;


Denis

0
Comment actions Permalink

I also switch git branches constantly from the terminal. However, when doing so, my IntelliJ 10 doesn't index anything at all. I've got "synchronize on frame activation" disabled.

Instead, IntelliJ 'discovers' that files got changed only at the time when I try to save... But I think that minor annoyance is worth the not indexing.

I rather work with a fast intellij that gets the references in the code right 'most of the time', than a slow intellij that gets the code references perfect all the time :)

But I just wish that when viewing a file, IntelliJ would discover that it changed immediately rather than just when saving.

I don't want to run multiple IntelliJ instances due to its bug where in Gnome the IntelliJ window buttons in the Gnome panel disappear, plus also because my branch switching is so chaotic that managing multiple IntelliJ's for each branch is impossible anyway.

0
Comment actions Permalink

... multiple IntelliJ instances due to its bug where in Gnome the IntelliJ window buttons in the Gnome panel disappear ...

This should be fixed in IDEA 11 (note Tools | Create Desktop Entry).

0
Comment actions Permalink

It was actually fixed in Gnome/Ubuntu, see http://youtrack.jetbrains.net/issue/IDEA-17899 for details.

0

Please sign in to leave a comment.