[Geany-devel] editing big files can be too slow with tag reparsing

Colomban Wendling lists.ban at xxxxx
Mon Sep 26 15:11:54 UTC 2011


Le 24/09/2011 12:39, Lex Trotman a écrit :
> On 24 September 2011 20:33, Colomban Wendling
> <lists.ban at herbesfolles.org> wrote:
>> Le 23/09/2011 03:09, Lex Trotman a écrit :
>>> On 23 September 2011 10:34, Matthew Brush <mbrush at codebrainz.ca> wrote:
>>>> On 09/22/2011 09:30 AM, Nick Treleaven wrote:
>>>>>
>>>>> Hi,
>>>>> Whilst opening doc/geany.html I found it takes >5s on my machine to
>>>>> load. It's a big document though, still perhaps the HTML tag parser
>>>>> performance could be improved.
>>>>>
>>>>
>>>> Well under 1 second to load geany.html here, and editing it is quite smooth
>>>> as well.
>>>
>>> Ditto, but of course it depends on the machine.
>>
>> Same here, I don't see any kind of lag with that file.  But yeah,
>> depends a lot on the machine's power.
>>
>>>> Myself, I've found the biggest slowdown is when having lots of tags files,
>>>> say more than 10 maybe.  If I have all my Vala tags (the ones on the Wiki)
>>>> loaded, Geany basically becomes unusable.
>>>
>>> IIUC the tags files are not re-loaded so the problem here suggests
>>> symbol lookup problems rather than parsing problems.
>>
>> Actually, IIRC Tagmanager updates an array holding all workspace tags
>> every time an update is done, so having many tags file or many open
>> files of a same filetype *may* (?) reduce the performances.
>> No guarantees on that though, there are too many dark corners in
>> Tagmanager (:-')
> 
> Are you saying that it re-reads all open tags files every time it
> re-parses a source file?  That would certainly make it slow.
> 
> And if it is just an array, unless the array is indexed or sorted then
> searching it would be slow for computing the auto-completions.

1) tm_workspace keeps a sorted array of all non-global tags, that is
rebuilt on each reparse [1].  This needs to rebuild and sort an array
holding all tags (I suspect that this may be "slow" with many tags), but
don't need reparsing anything.

2) As Matthew said in another mail, tm_tags_find() uses bsearch() [2] so
it's not that slow upon search.  Note however that scope completion is a
complete other topic -- BTW it's still broken... :/


Cheers,
Colomban


[1] tm_workspace.c:tm_workspace_update()
[2] tm_tag.c:tm_tags_find()



More information about the Devel mailing list