XVincentX / vscode-apielements

VSCode extensions for API Elements (aka: API Blueprint and Swagger)
MIT License
120 stars 15 forks source link

Improve AST traversal speed for symbols #44

Open jsynowiec opened 8 years ago

jsynowiec commented 8 years ago

After the last update I've noticed that the symbol navigation is quite often rebuilding and it takes some time. I'm not sure if it was like this earlier, because now I'm using this feature a lot more.

apielements

vscode 1.4.0 apielements 0.3.0 blueprint with ~ 80 symbols

XVincentX commented 8 years ago

Hey,

I will try to investigate into but I think the main problem would be the increased number of symbols we have now given we're putting transitions into the game as well.

I'll try with a large blueprint (or if you're willing to share yours, it would be better) and try to understand what's going on there.

jsynowiec commented 8 years ago

Unfortunately I can't share this particular specification due to legal agreements :(

XVincentX commented 8 years ago

I understand that. I'll look into with some large blueprint I'll try to find around and see what's going on here.

XVincentX commented 8 years ago

@jsynowiec

I made some investigations and I didn't find any bug. I mean, if symbols are getting rebuilt, it's because they need to.

Fundamentally VSCode triggers the symbols rebuild when it detects that the document has been changed. The problem here is the tree traversing time, which might be time consuming.

I should probably start to track the AST traverse time as well try to cut useless traversals. I'll see what I can do.

jsynowiec commented 8 years ago

Thanks for the notice. I look forward to those improvements. I can do some beta-testing if you want.

XVincentX commented 8 years ago

That's going to be hard. I'll keep you posted

XVincentX commented 8 years ago

Note: evaluate sift

XVincentX commented 8 years ago

Note: image

This is not helping traversing the three. Sourcemaps and descriptions location are predictable, so get rid of that ASAP.

XVincentX commented 8 years ago

This is going to be put as part of effort to bring data structures into the extension.

jsynowiec commented 8 years ago

I can confirm that the 0.5.0 update is performing noticeably better on the same set of symbols.