News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

CC: Expensive calls on opening new files

Started by dmoore, June 21, 2007, 11:12:05 PM

Previous topic - Next topic

rickg22

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 :)

dmoore

then won't that mean all those scintilla events get processed when opening a big file outside of a project?
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

rickg22

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.

dmoore

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)
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

dmoore

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.
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

rickg22

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... :(


dmoore

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...
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

rickg22

how long is your file in question? Can I have a copy for later tests?

dmoore

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)
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

rickg22

#24
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?