Commit feeee2e
[sources] Remove constant re-creation of 'children' array
The NavigatorTreeNode in the 'Sources' panel stashes the children in a
Map internally but hands out an array for it's 'children' accessor.
The implementation spreads the Map#values into an array.
When debugging web apps with thousands of files that are deeply nested,
this becomes noticeable and a performance trace where we spend 25
seconds executing JS in DevTools, we spend ~500ms just spreading child
NavigatorTreeNodes.
This CL fixes this by maintaining both a map and an array for a tree
nodes' children. We also extract a new helper method 'updateId' so
we can use private fields for both the map and the array.
[email protected]
Bug: None
Change-Id: I42d1a7f6934dc05babbb055aaf9d19780004c759
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6190894
Commit-Queue: Simon Zünd <[email protected]>
Reviewed-by: Philip Pfaffe <[email protected]>1 parent bfbcc4c commit feeee2e
File tree
1 file changed
+26
-13
lines changed- front_end/panels/sources
1 file changed
+26
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1024 | 1024 | | |
1025 | 1025 | | |
1026 | 1026 | | |
1027 | | - | |
| 1027 | + | |
1028 | 1028 | | |
1029 | 1029 | | |
1030 | 1030 | | |
| |||
1526 | 1526 | | |
1527 | 1527 | | |
1528 | 1528 | | |
1529 | | - | |
1530 | 1529 | | |
1531 | 1530 | | |
1532 | 1531 | | |
1533 | 1532 | | |
1534 | 1533 | | |
1535 | 1534 | | |
1536 | 1535 | | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
1537 | 1539 | | |
1538 | 1540 | | |
1539 | 1541 | | |
1540 | 1542 | | |
1541 | | - | |
1542 | 1543 | | |
1543 | 1544 | | |
1544 | 1545 | | |
| |||
1625 | 1626 | | |
1626 | 1627 | | |
1627 | 1628 | | |
1628 | | - | |
| 1629 | + | |
1629 | 1630 | | |
1630 | 1631 | | |
1631 | | - | |
1632 | | - | |
| 1632 | + | |
| 1633 | + | |
1633 | 1634 | | |
1634 | 1635 | | |
1635 | 1636 | | |
1636 | | - | |
| 1637 | + | |
1637 | 1638 | | |
1638 | 1639 | | |
1639 | 1640 | | |
1640 | | - | |
| 1641 | + | |
| 1642 | + | |
1641 | 1643 | | |
1642 | 1644 | | |
1643 | 1645 | | |
1644 | 1646 | | |
1645 | 1647 | | |
1646 | 1648 | | |
1647 | | - | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
1648 | 1654 | | |
1649 | 1655 | | |
1650 | 1656 | | |
1651 | 1657 | | |
1652 | 1658 | | |
1653 | | - | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
1654 | 1669 | | |
1655 | 1670 | | |
1656 | 1671 | | |
| |||
1748 | 1763 | | |
1749 | 1764 | | |
1750 | 1765 | | |
1751 | | - | |
1752 | | - | |
1753 | | - | |
| 1766 | + | |
1754 | 1767 | | |
1755 | 1768 | | |
1756 | 1769 | | |
| |||
0 commit comments