ejgallego / coq-lsp

Visual Studio Code Extension and Language Server Protocol for Coq
GNU Lesser General Public License v2.1
143 stars 31 forks source link

heatmap display for timing data #686

Closed Alizter closed 4 months ago

Alizter commented 4 months ago

Here is a proof-of-concept for #681. Currently we generate random data and display that instead. I haven't been able to workout how we can get timing data yet.

Here is a PR implementing #681. We add an optional heatmap overlay to a file which visualizes the performance data. The screenshot below shows the timing data in a file being visualized.

image

TODO

ejgallego commented 4 months ago

Getting the data should not be hard, questions:

Alizter commented 4 months ago

I think if we want it to be incremental the server should notify the client. Presumably when we do the progress updates.

Right now the data is refreshed everytime you move the cursor or activate the window which obviously doesn't scale too well. I would prefer that this is refreshed when a notification is recieved. The colouring is relative, so if we get a line with a large value relative to the rest, all the lines will need to be recoloured.

Alizter commented 4 months ago

image

ejgallego commented 4 months ago

Ok, rebased and working now!

IMHO I would cleanup this a bit, add an example, and maybe merge. I guess the heatmap will require some fine tuning with real files, but even in basic form that's a very cool addition.

Alizter commented 4 months ago

This appears to be working really well. The configuration options also appear to work, though it is very likely there are some bugs. I set it up so that the options update the heatmap in real time without having the reload the extension which might be useful.

I think I want to add a hover functionality in heatmap mode so that we can actually see the values being highlighted. We obviously have something via the debug stats, but having something more user facing might be useful.

ejgallego commented 4 months ago

Indeed, once the bugs in the backend were fixed, this seems to be pretty nice and not too complex!

I think I want to add a hover functionality in heatmap mode so that we can actually see the values being highlighted. We obviously have something via the debug stats, but having something more user facing might be useful.

Maybe we could re-use the existing hover for performance data, in order to do this, we'd need:

Alizter commented 4 months ago

OK that is a bit more complex than I imagined. I think I will leave that as a feature request for now as to not stall this feature.

Alizter commented 4 months ago

@ejgallego I think this is ready.

ejgallego commented 4 months ago

Maybe also squash if you want.

Alizter commented 4 months ago

@ejgallego Changelogs updated and commits squashed.