[Geany-devel] Request: multithreaded tag generation?

Jiří Techet techet at xxxxx
Sat Jan 28 00:58:37 UTC 2012


On Tue, Jan 24, 2012 at 12:17, Lex Trotman <elextr at gmail.com> wrote:
> On Tue, Jan 24, 2012 at 9:56 PM, Harold Aling <geany at sait.nl> wrote:
>> On Tue, Jan 24, 2012 at 11:42, Jon Senior <jon at restlesslemon.co.uk> wrote:
>>> On Tue, 24 Jan 2012 11:35:40 +0100
>>> Harold Aling <geany at sait.nl> wrote:
>>>
>>>> Just had a little time to check loading times with GeanyPRJ versus
>>>> GProject.
>>>>
>>>> Starting Geany with 1 file open in a Drupal project with GProject
>>>> enabled: 4 minutes and 1 second.
>>>> Starting Geany with the same file with GeanyPRJ enabled: 23 seconds.
>>>>
>>>> Quitting Geany with an open Drupal project with GProject enabled:
>>>> about 4 minutes.
>>>> Quitting Geany with the same Drupal project with GeanyPRJ enabled:
>>>> almost instant.
>>>>
>>>> The second time I opened the project with GProject, it only took 3
>>>> minutes, so it has some caching benefits.
>>>>
>>>>
>>>> I'm reverting to GeanyPRJ! Too bad it causes a lag while typing, but
>>>> that's way better than having to wait 4 minutes to start or quit
>>>> Geany...
>>>
>>> Am I really that weird? Granted I'm using geanie's built-in project
>>> support (More like managed sessions), but I see a worst case for my use
>>> of about 45 seconds to load a series of files.
>>
>> I've set GProject to index all files in the project to be able to use
>> ''Go to tag definition" so it's the time to reindex all files and
>> tags, not just opening them...
>>
>>> But the thing is, my current "session" of geany has been open now for
>>> about 4 days. 4 minutes in that time frame is a drop in the ocean. How
>>> often do you open + close geany for a 4 minute start up to be more
>>> annoying than a continuous lag when typing?
>>
>> Well, I work on 1 to 4 Drupal projects per week and sometimes I have
>> to bughunt on even more projects. Every switch will take 4 to 8
>> minutes, which is "not very relaxing", especially if a collegue is
>> standing here at my desk...
>>
>> I also like to shutdown my machine in the weekends to prevent me from
>> logging in from home ;)
>
> There's an idea, but since I work from home the machine is right
> there, stalking me...
>
> What might be a better idea than re-generating 1000 files worth of
> symbols each time is to run offline tags file generation, hopefully
> loading those will be faster than re-parsing all the files.  Maybe you
> can test it some time.
>
> And Geany will correct any errors in symbols for the files you have
> open and have changed.
>
> All we need to add is the ability to save this over the top of the old
> tags file when the source file is saved, so you continue to get right
> symbols with the file closed.  This is something that will be much
> more likely to happen in the near future compared to threaded parsing,
> there are too many problems with data sharing with the GUI thread, as
> discussed several times on IRC in the past.
>
> Depends how much faster loading tags files is to see if its worth it.

OK, there's a plugin called gctags which I've been using for almost
two years now but haven't had time to polish it and make part of
geany-plugins. I've uploaded the plugin here:

https://github.com/techee/geany-gctags

How it works:
1. You need to have ctags installed in your system
2. In project->properties you set the file patterns which should be
scanned for tags
3. There's a new menu item Project->generate tags - it scans all the
files satisfying the patterns and creates tags file with the same name
as the project file but with the extension .tags
4. There's Project->Find tag menu item: it pops up a dialog where you
can search for the tag (you can assign keybinding for this action).
After hitting enter, all the tags which are found are printed to the
Messages window. I use some space-based indentation so it's better to
use monospace font for the Messages window. After clicking a tag, you
get to the corresponding line/file.
5. Instead of (4) you can use the context menu which has two new
entries - "Find tag definition" and "Find tag declaration" - these
print the definition/declaration of the symbol under cursor
immediately.

The plugin doesn't do any smart reloading of tags - you have to do it
manually from the menu. However in practice this has never been a
problem for me - for recently used files you can use Geany's search in
open files. When you find the tags are off or cannot be found, you can
regenerate them manually - this is extremely FAST compared to what
Geany needs for "parsing" (parsing is in apostrophes because it's not
the parsing which is slow - it's some crazyness in the tag manager).

I've been working on very large projects (2 millions LOC in C) and
this has been working very well for me. I've always disabled the tag
generation by Geany because it's way too slow for any bigger project.

Cheers,
Jiri



More information about the Devel mailing list