On Wed, 23 Mar 2011 23:49:41 +1100 Lex Trotman elextr@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;