[Geany-devel] Performance issues?
Yura Siamashka
yurand2 at xxxxx
Sun Mar 27 01:31:40 UTC 2011
On Wed, 23 Mar 2011 23:49:41 +1100
Lex Trotman <elextr at gmail.com> wrote:
> Thats a bit harder, probably Yura, the plugin writer will need to take
> a look at the problem I'd say.
I looked at the problem:
1) geanyprj act only on "document-open", "document-save", "document-activate" callbacks
2) geanyprj add a lot of TMWorkObject objects using tm_workspace_add_object() to Geany
3) Geany call update_tags_from_buffer() very often.
I think this function somehow reparse a lot of objects because of "update_parent" param. I am not sure what this param actualy mean but if I change function this way performance is back to normal (I don't say we need to change it, it is just research):
--- a/src/document.c
+++ b/src/document.c
@@ -2263,7 +2263,7 @@ static gboolean update_tags_from_buffer(GeanyDocument *doc)
/* we copy the whole text into memory instead using a direct char pointer from
* Scintilla because tm_source_file_buffer_update() does modify the string slightly */
sci_get_text(doc->editor->sci, len, text);
- result = tm_source_file_buffer_update(doc->tm_file, (guchar*) text, len, TRUE);
+ result = tm_source_file_buffer_update(doc->tm_file, (guchar*) text, len, FALSE);
g_free(text);
#endif
return result;
--
Yura Siamashka <yurand2 at gmail.com>
More information about the Devel
mailing list