High CPU usage in VSCode
Hi,
And first of all thanks for this wonderful tool.
When trying to use radian in VSCode (just by launching it in an integrated terminal, even with all VSCode extensions disabled), I notice a high CPU usage.
By using the VSCode developer tools, it seems that the <div> element containing radian's prompt is constantly rewritten, as if the prompt is continuously "redrawn". This doesn't happen when launching a regular R session.
I tried to take a look at radian's code, but my knowledge of Python is far too limited. I also tried to disable radian's features but without effect.
I know this is quite a minor issue not directly related to radian. Many thanks in advance if you have any idea.
Does it happen in an external ~~window~~ terminal?
In another terminal, no, but I just tested it in RStudio, which is also a web-based application with an integrated terminal, and I get the same result : high CPU usage because the prompt line is constantly rewritten.
And I also see an increased CPU usage when launching it inside a shell in Emacs...
I have just realized it also happens on the macOS. Let me do some testing.
I was able to find the offending commit: https://github.com/randy3k/radian/commit/ff2064121fda7b2782ffd822c3546afa93bd2c25
It was introduced to so that later::later could be interrupted. Will need to work around it.
The master branch should fix the heavy load issue. We will need to find another workaround for later::later.
That was quick ! I can confirm it is fixed here too.
Many thanks !
I'm still running into this problem with radian 0.5.4. Has it really been fixed?
What OS are you using? Are you running VSCode?
Are you running VSCode?
Well, yes, that's why I posted in the VSCode issue.... I'm on Windows 10 1909, running R 4.0.0. Here is the output of pip list:
Package Version
------------- --------
asn1crypto 0.24.0
certifi 2019.3.9
cffi 1.12.2
chardet 3.0.4
conda 4.6.14
cryptography 2.6.1
idna 2.8
lineedit 0.1.5
menuinst 1.4.16
pip 19.0.3
pycosat 0.6.3
pycparser 2.19
Pygments 2.5.2
pyOpenSSL 19.0.0
PySocks 1.6.8
pywin32 223
radian 0.5.4
rchitect 0.3.25
requests 2.21.0
ruamel-yaml 0.15.46
setuptools 41.0.0
six 1.12.0
urllib3 1.24.1
wcwidth 0.1.7
wheel 0.33.1
win-inet-pton 1.1.0
wincertstore 0.2
Maybe a Windows issue. The issue was fixed in macOS.
I cannot really reproduce it

Yeah, it's kind of intermittent. It only seems to happen after the session has been going for some time, with a lot of use.
Then I am not sure if it is radian's own issue...
Well, I don't recall seeing this problem with an earlier version of radian, so something must have changed. Unfortunately I can't remember what version I was using, or even if VSCode itself has changed....
After a bunch of updates (Windows, VSCode, radian, R, python) this seems to be fixed. Fingers crossed.