Skip to content

Conversation

jevenski
Copy link
Contributor

@jevenski jevenski commented Dec 17, 2024

  • Remove rows and cols properties from dxSTable class and define them using getter functions. Previously they need to be updated manually when adding or removing rows/columns. The new method extracts the up-to-date numbers directly from the rows/cols-data, so that the numbers don't need to be updated manually.
  • Remove properties referring to various s-table parts and define getter functions to get a reference to them as well. This way the creation process of s-tables can be combined into one piece of code snippet with jQuery DOM creation functionality and thus making maintenance easier, instead of being scattered across many lines. The process can be further polished in the future, just so much for now to keep changes to a minimum.

- Remove `rows` and `cols` properties from dxSTable class and define
  them using getter functions. Previously they need to be updated
  manually when adding or removing rows/columns. The new method
  extracts the up-to-date numbers directly from the rows/cols-data,
  so that the numbers don't need to be updated manually.
- Remove properties referring to various s-table parts and define
  getter functions to get a reference to them as well. This way the
  creation process of s-tables can be combined into one piece of
  code snippet with jQuery DOM creation functionality and thus making
  maintenance easier, instead of being scattered across many lines.
  The process can be further polished in the future, just so much for
  now to keep changes to a minimum.
@stickz stickz merged commit 7653dd8 into Novik:develop Dec 22, 2024
@jevenski jevenski deleted the stable-getter branch December 22, 2024 02:32
stickz added a commit to stickz/docker-rtorrent-rutorrent that referenced this pull request Apr 27, 2025
**Full Changelog**: Novik/ruTorrent@v5.1.7...v5.2.1

# ruTorrent v5.2.1
This is a critical hotfix to resolve breakage of RSS feeds. It's highly recommended to upgrade.
In addition, the white border is fixed on dark themes. A stopped state is also added to torrents.

## What's Changed
* Adding Stopped state by ranirahn in Novik/ruTorrent#2893
* Fix for broken RSS feeds break the rutorrent. by ranirahn in Novik/ruTorrent#2894
* Fix white border in dark themes by drrako in Novik/ruTorrent#2898

**Full Changelog**: Novik/ruTorrent@v5.2.0...v5.2.1

# ruTorrent v5.2.0 is now Stable
This is a release contains more mobile design improvements, performance improvements and various new features. It builds on progress made in ruTorrent `v5.1` toward mobile development. 

## Critical Improvement Summary

1. Torrents now have bigger font to make them easier to read.
2. There is no more drag mask when moving around dialog boxes.
3. Internet explorer is no longer supported. (Yes finally, we dropped it)
4. Various performance improvements to tables to improve responsiveness.
5. The clear log now has a bootstrap button in the bottom right corner.
6. Many other smaller improvements, bug fixes and new features.

## What's Changed
* Fix torrent deleted without confirmation by koblack in Novik/ruTorrent#2804
* filedrop plugin: support dropped links by pekman in Novik/ruTorrent#2806
* Remove drag mask object by jevenski in Novik/ruTorrent#2805
* Covert clear log to a floating button by jevenski in Novik/ruTorrent#2810
* Use bootstrap dropdown on recent trackers by jevenski in Novik/ruTorrent#2809
* Use flex layout on context menu items by jevenski in Novik/ruTorrent#2812
* Adjust status bar and top menu by jevenski in Novik/ruTorrent#2813
* Define dialog window colors using variables by jevenski in Novik/ruTorrent#2815
* Distribute WebUi space using flex layout by jevenski in Novik/ruTorrent#2826
* Remove Internet Explorer support, and some useragent sniffing hacks by anthonyryan1 in Novik/ruTorrent#2825
* Change various s-table methods by jevenski in Novik/ruTorrent#2821
* Define status bar icons using base64 strings by jevenski in Novik/ruTorrent#2833
* Animate category panel by jevenski in Novik/ruTorrent#2831
* Define getter functions on s-table by jevenski in Novik/ruTorrent#2830
* Use bootstrap list group on options window by jevenski in Novik/ruTorrent#2819
* Define s-table header styles using variables by jevenski in Novik/ruTorrent#2836
* Improve s-table column resizing by jevenski in Novik/ruTorrent#2837
* Control alternate row color using CSS by jevenski in Novik/ruTorrent#2841
* Improve move column function by jevenski in Novik/ruTorrent#2844
* Improve s-table header row hover event handler by jevenski in Novik/ruTorrent#2851
* Drag and drop s-table header using DnD class by jevenski in Novik/ruTorrent#2855
* Merge stable head and body into one table by jevenski in Novik/ruTorrent#2860
* Add danger color to #randomize_hash by anthonyryan1 in Novik/ruTorrent#2875
* Fix various bugs for v5.2 by jevenski in Novik/ruTorrent#2863
* Let rutracker_check ignore torrents with certain labels by drrako in Novik/ruTorrent#2866
* Add "::1" to localhost address list. by rozhuk-im in Novik/ruTorrent#2881
* Improve $tempDirectory handling: by rozhuk-im in Novik/ruTorrent#2880
* Diskspace option to display free bytes (new pull request against develop branch) by TheGoblinHero in Novik/ruTorrent#2890
* Add a permission to hide all torrent options by fffe in Novik/ruTorrent#2868
* Mark ruTorrent v5.2 as Stable by stickz in Novik/ruTorrent#2891

## New Contributors
* pekman made their first contribution in Novik/ruTorrent#2806
* rozhuk-im made their first contribution in Novik/ruTorrent#2881

**Full Changelog**: Novik/ruTorrent@v5.1.7...v5.2.0
@anthonyryan1
Copy link
Contributor

This seems to have caused a sizable performance regression in Chrome when 10K-20K torrents are seeding.

When scrolling, it now takes 9 seconds for 12,000 torrents on my mid-power machine for the next batch of rows to load. Firefox has no such problem.

The stacktrace for the hot path is:

get	@	stable.js?v=529:1585:22
dxSTable.setBodyState	@	stable.js?v=529:555:43
dxSTable.syncDOM	@	stable.js?v=529:1317:38
(anonymous)	@	stable.js?v=529:1437:54
requestAnimationFrame		
reqAFrame	@	stable.js?v=529:1430:20
dxSTable.syncDOMAsync	@	stable.js?v=529:1417:43
(anonymous)	@	stable.js?v=529:586:37
dispatch	@	jquery.js?v=529:2:39414
v.handle	@	jquery.js?v=529:2:37926

I've also attached a screenshot of the flame graph
Screenshot from 2025-06-16 14-58-05

I like this change, for reducing the risk of Out-Of-Sync bugs, but it's not looking good for Chromium performance. We'll need to find a way to de-duplicate some of the work happening far too often.

@anthonyryan1
Copy link
Contributor

Working on a pull request for this.

anthonyryan1 added a commit to anthonyryan1/ruTorrent that referenced this pull request Jun 16, 2025
Now that dxSTable.rows is a getter, and not a variable, we need to
be mindful about using it in for loops. On an ruTorrent with 20K
torrents, putting it into the for loop, instead of copying it into
a variable will result in 20K executions of the getter function
and tank performance.

By checking the rowcount once, before we start the loop, we can
keep the getter (reducing the risk of OOS bugs), without suffering
the performance penalty.

Related to Novik#2830
stickz pushed a commit that referenced this pull request Jun 18, 2025
* Fix Chrome performance regression

Now that dxSTable.rows is a getter, and not a variable, we need to
be mindful about using it in for loops. On an ruTorrent with 20K
torrents, putting it into the for loop, instead of copying it into
a variable will result in 20K executions of the getter function
and tank performance.

By checking the rowcount once, before we start the loop, we can
keep the getter (reducing the risk of OOS bugs), without suffering
the performance penalty.

Related to #2830

* Remove tr index attribute

It looks like it has lost it's original purpose and is now identical
on every single torrent when you first load it. It does look like
it will increment as new torrents are adedd. But I don't see a lot
of utliity. Nobody needs to reference the 57th torrent added to the
client.

It's also incurring a hefty performance penalty in the code. Removing
it now makes syncDom 5x faster. From 270 ms on my machine to 57 ms
reliabily in Chrome.
stickz pushed a commit that referenced this pull request Jun 18, 2025
* Fix Chrome performance regression

Now that dxSTable.rows is a getter, and not a variable, we need to
be mindful about using it in for loops. On an ruTorrent with 20K
torrents, putting it into the for loop, instead of copying it into
a variable will result in 20K executions of the getter function
and tank performance.

By checking the rowcount once, before we start the loop, we can
keep the getter (reducing the risk of OOS bugs), without suffering
the performance penalty.

Related to #2830

* Remove tr index attribute

It looks like it has lost it's original purpose and is now identical
on every single torrent when you first load it. It does look like
it will increment as new torrents are adedd. But I don't see a lot
of utliity. Nobody needs to reference the 57th torrent added to the
client.

It's also incurring a hefty performance penalty in the code. Removing
it now makes syncDom 5x faster. From 270 ms on my machine to 57 ms
reliabily in Chrome.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants