Author Topic: CC: Expensive calls on opening new files  (Read 22600 times)

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: CC: Expensive calls on opening new files
« Reply #15 on: June 24, 2007, 04:49:37 am »
IsBusy only is set when ProjectManager is loading or closing a project. So if you don't have open projects, it'll be fine, too :)

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: CC: Expensive calls on opening new files
« Reply #16 on: June 24, 2007, 01:58:15 pm »
then won't that mean all those scintilla events get processed when opening a big file outside of a project?

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: CC: Expensive calls on opening new files
« Reply #17 on: June 24, 2007, 04:55:52 pm »
Opening a file, even big, should be no problem, because the code completion events are only triggered ONCE per file per save. That's my fix.

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: CC: Expensive calls on opening new files
« Reply #18 on: June 24, 2007, 05:07:25 pm »
won't EditorEventHook be called irrespective of whether parsing is actually taking place? (it's registered within the scope of the entire plugin, not at the individual parser level)

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: CC: Expensive calls on opening new files
« Reply #19 on: June 24, 2007, 05:10:19 pm »
additionally other plugins that have an EditorEventHook will still get called during large file loads outside of projects. When using CB as a general purpose editor/viewer, short load times are very desirable.

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: CC: Expensive calls on opening new files
« Reply #20 on: June 25, 2007, 08:05:59 am »
If you use Code::Blocks as an editor, then you can disable the plugins. Codeblocks has an option, /profile=<profile_name>. You can specify profiles for usage and disable the plugins in those profiles. But I don't remember where to set that up... :(


Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: CC: Expensive calls on opening new files
« Reply #21 on: June 25, 2007, 12:28:10 pm »
yes, I use personalities frequently -- an excellent feature. I'm not pushing this point to aggravate you: it just seems like a simple fix to block those editor event hook calls during file opens as well as project opens...

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: CC: Expensive calls on opening new files
« Reply #22 on: June 25, 2007, 04:09:42 pm »
how long is your file in question? Can I have a copy for later tests?

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: CC: Expensive calls on opening new files
« Reply #23 on: June 26, 2007, 08:36:54 pm »
any large (4-5mb) syntax highlightable file will do (e.g. html, xml or , if you can find one, cpp file). I'm pretty sure editorhooks aren't registered on a per editor basis that discriminates by filetype. In fact it might be better to test on a non-cpp file to distinguish cycles spent on real parsing from redundant cycles spent in the editor hooks. for what it's worth, with CC on the scintilla events probably don't add more than about 30% to opening times, but given the simplicity of the fix I think it is worthwhile.

it would be even better to use a buffered loading model (like SciTE) that progressively adds to the file content, so that files appear instantaneously (integration with plugins would be tricky)

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: CC: Expensive calls on opening new files
« Reply #24 on: June 26, 2007, 09:08:21 pm »
So in other words you're editing a 4MB html file???? O.O

Ok, now I need to know. What exactly is the EXTENSION of the file you're editing? Also, are you trying to tell me that the editorhooks are called 4 million of times, one per character?
« Last Edit: June 26, 2007, 09:12:22 pm by rickg22 »