c9 / core

Cloud9 Core - Part of the Cloud9 SDK for Plugin Development https://c9.github.io/core/ https://c9.io
Other
2.56k stars 924 forks source link

Regarding lazy loading of outlines #86

Open ghost opened 9 years ago

ghost commented 9 years ago

Hello, we're developing a language plugin using jsonanalzyer, and we're seeing a situation where the loading of the outlines takes about 30 seconds (after) we have access to the IDE. Is there any way to speed up the lazy loading of outlines, and in general make the loading faster so that the plugin is registered without delay?

romanman commented 9 years ago

@faizkhan00 : just to add to that subject: we also see that in other languages there is also a strange delay for outline init.

nightwing commented 9 years ago

30 seconds is too long, it should be much faster. Could you give me an example of a plugin that demonstrates this problem.

ghost commented 9 years ago

@nightwing on our system we regularly see 30 second waits until the outlines load, this is for any language, including javascript (might be worth mentioning we have turned collab on our instance too). https://github.com/c9/c9.ide.language.javascript

nightwing commented 9 years ago

Do you see the same delay without collab?

ghost commented 9 years ago

@nightwing locally, no- it seems to only be with collab turned on.

Pike commented 9 years ago

I've seen something like this for non-jsonanalyzer, and I thought I filed a ticket. Can't find it, though. What I think happens is that the initial outline is triggered while the plugin isn't loaded, and the plugin registering doesn't trigger a refresh "of all the things in the worker". So the actual outline only shows up once the outline is regenerated, either by an edit, or a timeout?

ghost commented 9 years ago

@Pike Something close to this is probably happening; I noticed the c9 language plugin does something to compensate, ie. https://github.com/c9/c9.ide.language/blob/master/outline.js#L186-L192 and I'm wondering if this is whats happening, and our plugin is just failing to load fast enough to catch the next timeout.

Pike commented 9 years ago

... cringe ...

I'd try to add to onChangeMode() in the "registered" callback in https://github.com/c9/c9.ide.language/blob/master/language.js#L526 instead.

ghost commented 9 years ago

Hm, would that work for serverside (jsonalyzer) plugins as well? I'll need to look into that as it does seem promising...