Skip to content

Conversation

@ssigwart
Copy link
Contributor

This PR fixes #152010

To test, see the steps to reproduce in #152010. Running that test before and after should be a noticeable different. On my 2014 Macbook Pro, it's around 30 seconds vs ~2 seconds.

Copy link
Member

@jrieken jrieken left a comment

Choose a reason for hiding this comment

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

Thanks @ssigwart. This is a nice issue and good investigation. You are on the right path to fix this but I would go "one level deeper" See #152010 (comment) - all consumers are affected by this (hover, suggest, ghost text) and I would use the DebounceEventEmitter for this event onDidRenderAsync. That's the same approach as yours but at the source

@ssigwart
Copy link
Contributor Author

ssigwart commented Jul 2, 2022

Thanks, @jrieken. I couldn't find any class called DebounceEventEmitter, but I'm guessing you just meant to apply the Event.debounce change to markdownRenderer.ts, so I did that.

Copy link
Member

@jrieken jrieken left a comment

Choose a reason for hiding this comment

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

Sorry, I meant DebounceEmitter. You can also use Event.debounce but there is disclaimer about leakage when using the debounce-util to create a "public" event. In short, in this case it is best to use the DebounceEmitter

@jrieken jrieken added this to the July 2022 milestone Jul 4, 2022
@ssigwart
Copy link
Contributor Author

ssigwart commented Jul 5, 2022

Thank you. I updated to use DebounceEmitter.

@jrieken jrieken merged commit 648bcd1 into microsoft:main Jul 5, 2022
@ssigwart ssigwart deleted the markdownHang branch July 7, 2022 00:41
@github-actions github-actions bot locked and limited conversation to collaborators Aug 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suggestion Widget Hangs on Markdown

3 participants