@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Reduce the frequency of DOM scans to rebuild inlines when scrolling revisions

Summary:
Ref T13513. See PHI1734, which raises a concern about the performance of large revisions near the 100-change threshold.

Currently, `getInlines()` is called whenever the scroll position transitions between two changesets, and it performs a relatively complicated DOM scan to lift inlines out of the document.

This shows up as taking a small but nontrivial amount of time in Firefox profiles and should be safely memoizable.

Test Plan:
- Under Firefox profiling, scrolled through a large revision.
- Before change: `getInlines()` appeared as the highest-cost thing we're explicitly doing on profiles.
- After change: `getInlines()` was no longer meaningfully represented on profiles.
- Created inlines, edited inlines, etc. Didn't identify any broken behavior.

Maniphest Tasks: T13513

Differential Revision: https://secure.phabricator.com/D21261

+24 -17
+16 -16
resources/celerity/map.php
··· 13 13 'core.pkg.js' => '845355f4', 14 14 'dark-console.pkg.js' => '187792c2', 15 15 'differential.pkg.css' => '319dca29', 16 - 'differential.pkg.js' => '695827fc', 16 + 'differential.pkg.js' => 'bb2a17fc', 17 17 'diffusion.pkg.css' => '42c75c37', 18 18 'diffusion.pkg.js' => 'a98c0bf7', 19 19 'maniphest.pkg.css' => '35995d6d', ··· 379 379 'rsrc/js/application/dashboard/behavior-dashboard-move-panels.js' => 'a2ab19be', 380 380 'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '1e413dc9', 381 381 'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => '0116d3e8', 382 - 'rsrc/js/application/diff/DiffChangeset.js' => 'bfdae878', 382 + 'rsrc/js/application/diff/DiffChangeset.js' => 'e02670b5', 383 383 'rsrc/js/application/diff/DiffChangesetList.js' => 'b1b8500b', 384 384 'rsrc/js/application/diff/DiffInline.js' => 'b00168c1', 385 385 'rsrc/js/application/diff/DiffPathView.js' => '8207abf9', ··· 774 774 'phabricator-darklog' => '3b869402', 775 775 'phabricator-darkmessage' => '26cd4b73', 776 776 'phabricator-dashboard-css' => '5a205b9d', 777 - 'phabricator-diff-changeset' => 'bfdae878', 777 + 'phabricator-diff-changeset' => 'e02670b5', 778 778 'phabricator-diff-changeset-list' => 'b1b8500b', 779 779 'phabricator-diff-inline' => 'b00168c1', 780 780 'phabricator-diff-path-view' => '8207abf9', ··· 2019 2019 'bcec20f0' => array( 2020 2020 'phui-theme-css', 2021 2021 ), 2022 - 'bfdae878' => array( 2023 - 'javelin-dom', 2024 - 'javelin-util', 2025 - 'javelin-stratcom', 2026 - 'javelin-install', 2027 - 'javelin-workflow', 2028 - 'javelin-router', 2029 - 'javelin-behavior-device', 2030 - 'javelin-vector', 2031 - 'phabricator-diff-inline', 2032 - 'phabricator-diff-path-view', 2033 - 'phuix-button-view', 2034 - ), 2035 2022 'c03f2fb4' => array( 2036 2023 'javelin-install', 2037 2024 ), ··· 2123 2110 ), 2124 2111 'df3afa61' => array( 2125 2112 'phui-inline-comment-view-css', 2113 + ), 2114 + 'e02670b5' => array( 2115 + 'javelin-dom', 2116 + 'javelin-util', 2117 + 'javelin-stratcom', 2118 + 'javelin-install', 2119 + 'javelin-workflow', 2120 + 'javelin-router', 2121 + 'javelin-behavior-device', 2122 + 'javelin-vector', 2123 + 'phabricator-diff-inline', 2124 + 'phabricator-diff-path-view', 2125 + 'phuix-button-view', 2126 2126 ), 2127 2127 'e150bd50' => array( 2128 2128 'javelin-behavior',
+8 -1
webroot/rsrc/js/application/diff/DiffChangeset.js
··· 817 817 }, 818 818 819 819 getInlines: function() { 820 - this._rebuildAllInlines(); 820 + if (this._inlines === null) { 821 + this._rebuildAllInlines(); 822 + } 823 + 821 824 return this._inlines; 822 825 }, 823 826 824 827 _rebuildAllInlines: function() { 828 + if (this._inlines === null) { 829 + this._inlines = []; 830 + } 831 + 825 832 var rows = JX.DOM.scry(this._node, 'tr'); 826 833 var ii; 827 834 for (ii = 0; ii < rows.length; ii++) {