REditorSupport / languageserver

An implementation of the Language Server Protocol for R
Other
581 stars 94 forks source link

High CPU percentag while typing large objects name in jupyterlab with R kernel #593

Open niuniudevp opened 1 year ago

niuniudevp commented 1 year ago

As descripted in title, using jupyterlab-lsp with R kenel, while change object names(typing name) in cell, there will be high CPU cost using by R. I wonder if this is a bug or some thing wrong with my config image

randy3k commented 1 year ago

I think most of the cpu time was spent in scope_completion. @renkun-ken WDYT?

Tal500 commented 1 year ago

Implementing the optimization ideas in #618 would probably fix this issue.

renkun-ken commented 1 year ago

Would you like to try disabling scope completion by removing the line at

https://github.com/REditorSupport/languageserver/blob/1e71561a41ef59126273f16bbb466c0b30a2aa64/R/completion.R#LL477C27-L477C27

and see if the performance issue still persists?

niuniudevp commented 1 year ago

Would you like to try disabling scope completion by removing the line at

https://github.com/REditorSupport/languageserver/blob/1e71561a41ef59126273f16bbb466c0b30a2aa64/R/completion.R#LL477C27-L477C27

and see if the performance issue still persists?

It performs better after removing that line!

renkun-ken commented 1 year ago

Thanks for the feedback. Let me see if we could make it more efficient.