Commit 031230d
authored
[Flight] Stack Parallel Components in Separate Tracks (facebook#31735)
Stacked on facebook#31729
<img width="1436" alt="Screenshot 2024-12-11 at 3 36 41 PM"
src="https://github.com/user-attachments/assets/0a201913-0076-4bbf-be18-8f1df6c58313"
/>
The Server Components visualization is currently a tree flame graph
where parent spans the child. This makes it equivalent to the Client
Components visualization.
However, since Server Components can be async and therefore parallel, we
need to do something when two children are executed in parallel. This PR
bumps parallel children into a separate track and then within that track
if that child has more children it can grow within that track.
I currently just cut off more than 10 parallel tracks.
Synchronous Server Components are still in sequence but it's unlikely
because even a simple microtasky Async Component is still parallel.
<img width="959" alt="Screenshot 2024-12-11 at 4 31 17 PM"
src="https://github.com/user-attachments/assets/5ad6a7f8-7fa0-46dc-af51-78caf9849176"
/>
I think this is probably not a very useful visualization for Server
Components but we can try it out.
I'm also going to try a different visualization where parent-child
relationship is horizontal and parallel vertical instead, but it might
not be possible to make that line up in this tool. It makes it a little
harder to see how much different components (including their children)
impact the overall tree. If that's the only visualization it's also
confusing why it's different dimensions than the Client Component
version.1 parent f7b1273 commit 031230d
File tree
2 files changed
+71
-10
lines changed- packages/react-client/src
2 files changed
+71
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
| |||
642 | 643 | | |
643 | 644 | | |
644 | 645 | | |
645 | | - | |
| 646 | + | |
646 | 647 | | |
647 | 648 | | |
648 | 649 | | |
| |||
2740 | 2741 | | |
2741 | 2742 | | |
2742 | 2743 | | |
2743 | | - | |
| 2744 | + | |
| 2745 | + | |
| 2746 | + | |
| 2747 | + | |
| 2748 | + | |
2744 | 2749 | | |
2745 | | - | |
| 2750 | + | |
| 2751 | + | |
| 2752 | + | |
| 2753 | + | |
2746 | 2754 | | |
2747 | 2755 | | |
2748 | 2756 | | |
| |||
2753 | 2761 | | |
2754 | 2762 | | |
2755 | 2763 | | |
2756 | | - | |
| 2764 | + | |
| 2765 | + | |
| 2766 | + | |
2757 | 2767 | | |
2758 | 2768 | | |
2759 | 2769 | | |
| |||
2762 | 2772 | | |
2763 | 2773 | | |
2764 | 2774 | | |
2765 | | - | |
| 2775 | + | |
| 2776 | + | |
| 2777 | + | |
| 2778 | + | |
| 2779 | + | |
| 2780 | + | |
| 2781 | + | |
| 2782 | + | |
| 2783 | + | |
| 2784 | + | |
| 2785 | + | |
| 2786 | + | |
| 2787 | + | |
| 2788 | + | |
| 2789 | + | |
| 2790 | + | |
| 2791 | + | |
| 2792 | + | |
| 2793 | + | |
| 2794 | + | |
| 2795 | + | |
| 2796 | + | |
| 2797 | + | |
| 2798 | + | |
| 2799 | + | |
2766 | 2800 | | |
2767 | 2801 | | |
| 2802 | + | |
| 2803 | + | |
2768 | 2804 | | |
2769 | | - | |
| 2805 | + | |
| 2806 | + | |
| 2807 | + | |
| 2808 | + | |
| 2809 | + | |
| 2810 | + | |
| 2811 | + | |
| 2812 | + | |
2770 | 2813 | | |
2771 | 2814 | | |
2772 | 2815 | | |
2773 | 2816 | | |
2774 | | - | |
| 2817 | + | |
2775 | 2818 | | |
2776 | 2819 | | |
2777 | 2820 | | |
| |||
2790 | 2833 | | |
2791 | 2834 | | |
2792 | 2835 | | |
| 2836 | + | |
2793 | 2837 | | |
2794 | 2838 | | |
2795 | 2839 | | |
| |||
2798 | 2842 | | |
2799 | 2843 | | |
2800 | 2844 | | |
2801 | | - | |
| 2845 | + | |
| 2846 | + | |
2802 | 2847 | | |
2803 | 2848 | | |
2804 | 2849 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
35 | 49 | | |
36 | 50 | | |
| 51 | + | |
37 | 52 | | |
38 | 53 | | |
39 | 54 | | |
40 | 55 | | |
41 | | - | |
| 56 | + | |
42 | 57 | | |
43 | 58 | | |
44 | 59 | | |
| |||
49 | 64 | | |
50 | 65 | | |
51 | 66 | | |
| 67 | + | |
52 | 68 | | |
53 | 69 | | |
54 | 70 | | |
| |||
0 commit comments