Commit 6ba7afe
authored
Fix Chrome performance regression (#2960)
* 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.1 parent 1fb1b49 commit 6ba7afe
1 file changed
Lines changed: 13 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
554 | 554 | | |
555 | 555 | | |
556 | 556 | | |
557 | | - | |
| 557 | + | |
| 558 | + | |
558 | 559 | | |
559 | 560 | | |
560 | 561 | | |
561 | | - | |
562 | | - | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
563 | 565 | | |
564 | 566 | | |
565 | 567 | | |
| |||
726 | 728 | | |
727 | 729 | | |
728 | 730 | | |
729 | | - | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
730 | 734 | | |
731 | 735 | | |
732 | 736 | | |
| |||
941 | 945 | | |
942 | 946 | | |
943 | 947 | | |
944 | | - | |
| 948 | + | |
945 | 949 | | |
946 | 950 | | |
947 | 951 | | |
| |||
972 | 976 | | |
973 | 977 | | |
974 | 978 | | |
975 | | - | |
976 | | - | |
977 | | - | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
978 | 983 | | |
979 | 984 | | |
980 | 985 | | |
| |||
0 commit comments