Skip to content

Conversation

@renkun-ken
Copy link
Member

@renkun-ken renkun-ken commented Oct 10, 2021

What problem did you solve?

Closes #811

This PR

  • Adds a new value Normal to setting r.session.levelOfObjectDetail corresponding to vsc.str.max.level=1 so that the task callback performance is much better in most cases.
  • Adds a new setting r.session.objectTimeout to limit the cpu time of each capture.output(str(obj, max.level=)) call so that no single object takes too much time.

(If you do not have screenshot) How can I check this pull request?

Use the following example to check the performance in each case where r.session.levelOfObjectDetail is Minimal, Normal and Detailed.

n <- 10e4
ED <- lapply(1:20, function(i) {
  df <- lapply(1:60, function(j) rnorm(n))
  names(df) <- sprintf("x%d", seq_along(df))
  as.data.frame(df)
})

Both Minimal and Normal should have no notable performance issue, while Detailed would cause notable delay on user input.

@Fred-Wu
Copy link

Fred-Wu commented Oct 11, 2021

How can I download this latest built?

@renkun-ken
Copy link
Member Author

Download the artifact at https://github.com/REditorSupport/vscode-R/actions/runs/1327699240#artifacts which is at "Checks" -> "main push/pull request" -> artifacts.

@ElianHugh
Copy link
Collaborator

Sorry for the delay, been a bit swamped! I'll have a look over this now :)

Copy link
Collaborator

@ElianHugh ElianHugh left a comment

Choose a reason for hiding this comment

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

At first I didn't notice any difference between the three object detail settings, but I later realised this was because of the object timeout... Whoops! In that regard the fallback is pretty seamless!

As expected, minimal/normal settings do not occur a slowdown in comparison to detailed. Hover & str appear to be functioning as before.

LGTM! Thanks for the nice work!

@renkun-ken renkun-ken merged commit 0e01652 into master Oct 12, 2021
@renkun-ken renkun-ken deleted the str-level-1 branch March 5, 2022 17:46
ElianHugh pushed a commit to ElianHugh/vscode-R that referenced this pull request May 12, 2022
…Support#815)

* Add r.session.levelOfObjectDetail=Normal for max.level=1

* Add object timeout

* Update capture_str
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.

r.session.objectLengthLimit seems not working well

4 participants