Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fiber] Optimize enableProfilerCommitHooks by Collecting Elapsed Effect Duration in Module Scope #30981

Merged
merged 8 commits into from
Sep 17, 2024

Commits on Sep 16, 2024

  1. Move layout hook unmounting to helper

    Follows the pattern of the others.
    sebmarkbage committed Sep 16, 2024
    Configuration menu
    Copy the full SHA
    ba3af2f View commit details
    Browse the repository at this point in the history
  2. Unify Hook Deletion on Unmount

    This can use commitHookEffectListUnmount helper. The net effect is that
    all insertion effects unmount first and then all layout effects.
    
    That's the order that happens for updates and mounts and mirrors
    how generally different phase unmounts happen.
    sebmarkbage committed Sep 16, 2024
    Configuration menu
    Copy the full SHA
    bc36701 View commit details
    Browse the repository at this point in the history
  3. Similarly this should use the commitHookLayoutUnmountEffects

    This wrapper adds the timings of layout effects.
    sebmarkbage committed Sep 16, 2024
    Configuration menu
    Copy the full SHA
    fdd833f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f5775d7 View commit details
    Browse the repository at this point in the history
  5. Track the currently computing effect durations on module scope

    When we enter or leaves a Profiler boundary we can collect the effect duration
    elapsed within that scope and add it to the counter.
    
    This avoids needing to search back up for every Fiber.
    sebmarkbage committed Sep 16, 2024
    Configuration menu
    Copy the full SHA
    2c9b1ee View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    aa36862 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    202fdec View commit details
    Browse the repository at this point in the history
  8. Unify startEffectTimer and recordEffectDuration

    We infer if this was layout or passive duration when we propagate the number in the phase.
    
    We can also just use the same start timer as for render since they don't overlap.
    sebmarkbage committed Sep 16, 2024
    Configuration menu
    Copy the full SHA
    a41c35f View commit details
    Browse the repository at this point in the history