Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize WebUI.addTorrents #2264

Merged
merged 1 commit into from
Jan 17, 2022
Merged

Optimize WebUI.addTorrents #2264

merged 1 commit into from
Jan 17, 2022

Conversation

stickz
Copy link
Collaborator

@stickz stickz commented Jan 13, 2022

This pull request optimizes the WebUI.addTorrent() function. It allows us to start rendering the WebUI, without having to wait for the torrent rows to refresh. In most cases, this reduces the TBT of the main thread by at least 50ms.

The torrent rows now refresh asynchronously, so it doesn't slow down the adding of torrents into the WebUI. The function chain which invokes dxSTable.refreshRows() can be done any time, as the objects are stored in the WebUI.

With this pull request, WebUI.loadTorrents() which invokes WebUI.show() now completes within 3ms instead of 60ms. The torrent rows will refresh when the main thread is no longer blocked and the WebUI has been shown.

@Novik Novik merged commit fc9d1f0 into Novik:master Jan 17, 2022
@stickz stickz deleted the OptimizeAddTorrents branch January 17, 2022 13:00
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.

2 participants