Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #2315: fine grain marker tree computation #2316

Merged
merged 2 commits into from
Jul 11, 2018

Conversation

akosyakov
Copy link
Member

No description provided.

@akosyakov
Copy link
Member Author

@marcdumais-work please try, it turned out that:

  • the whole marker tree was rebuilt even if markers only for one resource were reported, now it should be incremental
  • saving data to the local storage is expensive, we store markers whenever any marker is changed. I've added debouncing, but I think we can actually save them only once on page unload similar to how we store the layout info or don't store markers at all

@svenefftinge
Copy link
Contributor

I think we should even consider not storing markers in storage at all. It might auto-fix a couple of issues we have with stale markers.

@akosyakov
Copy link
Member Author

@svenefftinge @marcdumais-work I've removed storing markers by default, a specialization of marker manager can decide on their own. For cases which I know it does not make sense to store them, but can imagine that it can be useful for breakpoints for example.

@marcdumais-work
Copy link
Contributor

will try this PR now, thanks @akosyakov

@marcdumais-work
Copy link
Contributor

I've removed storing markers by default, a specialization of marker manager can decide on their own. For cases which I know it does not make sense to store them

True, e.g. for TypeScript, where the markers are created by the LS when a file is opened and cleared when it's closed. In that case, the markers will be re-created when we reload a workspace, since the opened files will be restored.

When we have markers created during a build, we will need to re-trigger the build to get back the markers after a reload, I think? Or have the build component itself res/store the markers maybe?

@svenefftinge
Copy link
Contributor

The problems widget should also not store its state.

@akosyakov
Copy link
Member Author

When we have markers created during a build, we will need to re-trigger the build to get back the markers after a reload, I think? Or have the build component itself res/store the markers maybe?

In VS Code they don't store markers and expect that a language server reports all of them each time. For us, it should be safe to assume the same. Also, I see that Java LS reports them each time.

@marcdumais-work
Copy link
Contributor

I see that Java LS reports them each time.

This might be incidental. From a previous discussion, I remember that the jdt creates an eclipse workspace each time Theia is started, IIRC to avoid issues with (Eclipse) WS corruption. If not for that, it might not build each time.

@marcdumais-work
Copy link
Contributor

I tried the PR and it's really fast now - as fast as jdt can provide the problems, it seems.

I noticed a bug: when I toggle the Problems view, it comes back empty. Similar, if I start with Problems view not present and open it later, it's also empty.

@akosyakov
Copy link
Member Author

akosyakov commented Jul 10, 2018

This might be incidental.

They have to report each time, otherwise, there won't be problem markers in VS Code.

I noticed a bug: when I toggle the Problems view, it comes back empty. Similar, if I start with Problems view not present and open it later, it's also empty.

thanks! i will have a look

@AlexTugarev
Copy link
Contributor

From a previous discussion, I remember that the jdt creates an eclipse workspace each time Theia is started, IIRC to avoid issues with (Eclipse) WS corruption.

Actually, it's @theia/java configuration. For the same workspace, I think it should reuse the same eclipse workspace, cf. #1745. That would speed up reloading a lot.

If not [recreating a workspace], it might not build each time.

We can test it easily, by using a fixed path for the eclipse workspace, and see if the markers are reported again. AFAIK resource markers are persisted in eclipse, might be that there are reused.

@marcdumais-work
Copy link
Contributor

it's @theia/java configuration

@AlexTugarev do you know where that config is, that I could point to a fixed path?

@AlexTugarev
Copy link
Contributor

@marcdumais-work
Copy link
Contributor

@AlexTugarev Thanks!

@marcdumais-work
Copy link
Contributor

marcdumais-work commented Jul 10, 2018

We can test it easily, by using a fixed path for the eclipse workspace, and see if the markers are reported again. AFAIK resource markers are persisted in eclipse, might be that there are reused.

I did this and indeed the markers are reported again after F-E reload. It did not feel as the markers were re-used, as they came-in at the same pace over a minute or two, like when a new workspace is used.

@akosyakov akosyakov force-pushed the ak/marker_tree_optimization branch from ec169c1 to 5b9623c Compare July 10, 2018 13:36
@akosyakov
Copy link
Member Author

@marcdumais-work I've removed storing the state of the problems view. Could you try again? it could be that an issue with an empty problems view was caused by a race between layout restoration and markers from Java LS. If you can reliably reproduce please describe how. I struggle to reproduce it.

@marcdumais-work
Copy link
Contributor

ok, will re-test with latest

@marcdumais-work
Copy link
Contributor

I still have the issue. For me it's very simple to reproduce. Open the Problems view and open a .java file. Wait until the LS is done reporting the issues it found. Then close and re-open the view:

Additionally, I had not noticed before, it looks like when the view is filling-up, we are missing some refresh, that makes it so that we do not see more than the markers for the originally opened file. You can see both in this video:

peek 2018-07-10 14-21

Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
@akosyakov akosyakov force-pushed the ak/marker_tree_optimization branch from 5b9623c to 650e3a2 Compare July 11, 2018 08:30
@akosyakov
Copy link
Member Author

akosyakov commented Jul 11, 2018

I still have the issue. For me it's very simple to reproduce. Open the Problems view and open a .java file. Wait until the LS is done reporting the issues it found. Then close and re-open the view:

Got you. I was collapsing the view, not closing it. Please pull and try again, it should be fixed. thanks!

Additionally, I had not noticed before, it looks like when the view is filling-up, we are missing some refresh, that makes it so that we do not see more than the markers for the originally opened file. You can see both in this video:

I did it on purpose that the view is not rerendered while Java LS is spamming with diagnostics. In practice after initial diagnostics reported there won't be delays as you type.

Copy link
Contributor

@marcdumais-work marcdumais-work left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LTGM. Performance with a lot of problem markers from lots of files is amazing with this PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants