Skip to content

Revert: Performance: Parallelize recursive directory copying (#2409) - #2520

Merged
ivan-ottinger merged 3 commits into
trunkfrom
revert/file-copy-logic
Feb 3, 2026
Merged

Revert: Performance: Parallelize recursive directory copying (#2409)#2520
ivan-ottinger merged 3 commits into
trunkfrom
revert/file-copy-logic

Conversation

@ivan-ottinger

@ivan-ottinger ivan-ottinger commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

Summary

The copy logic will be revisited in #2502.

Related issues

Testing Instructions

  1. Check out the PR branch and build the app with npm install && npm start.
  2. Create several new sites.
  3. The process should work correctly, the sites should get created and run without any issues.
@ivan-ottinger ivan-ottinger self-assigned this Feb 3, 2026
@ivan-ottinger
ivan-ottinger requested a review from a team February 3, 2026 11:14
@wpmobilebot

wpmobilebot commented Feb 3, 2026

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing da1097b vs trunk

site-editor

Metric trunk da1097b Diff Change
load 2867.00 ms 2923.00 ms +56.00 ms 🔴 2.0%

site-startup

Metric trunk da1097b Diff Change
siteCreation 7067.00 ms 7075.00 ms +8.00 ms 🔴 0.1%
siteStartup 3925.00 ms 3934.00 ms +9.00 ms 🔴 0.2%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change

@sejas sejas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The revert works as expected. I was able to create and start new sites.

@epeicher epeicher left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ivan-ottinger for working on a better option! I have tested creating multiple sites on both Mac and Windows, and I have not found any issues. On Windows, the performance of creating a site is still not good, but I have compared with trunk and this branch seems to be slightly better.LGTM! :shipit:

Sites created on Mac Sites created onWindows
Image Image
This reverts the changes from PR #2409 which replaced the custom
recursiveCopyDirectory function with fs-extra's copy. Brings back the
sequential recursive copy implementation.
@ivan-ottinger
ivan-ottinger force-pushed the revert/file-copy-logic branch from e077456 to 0ef05ee Compare February 3, 2026 11:39
Keep the fix from PR #2521 that always copies sqlite-command files
on startup to ensure files are complete, but use recursiveCopyDirectory
instead of fs.copy as part of the revert.
@ivan-ottinger

Copy link
Copy Markdown
Contributor Author

Thank you for your reviews, everyone!

For completeness, the performance results of the original PR showed site creation slowdown despite my results in manual testing. This was a motivation to revert those changes in this PR.

Interestingly, the performance results on this PR does not show any significant difference. The same is true when running the performance tests locally:

  ┌────────────────────────┬───────────────┐
  │         Branch         │ Site Creation │
  ├────────────────────────┼───────────────┤
  │ revert/file-copy-logic │ 7096 ms       │
  ├────────────────────────┼───────────────┤
  │ trunk                  │ 7039 ms       │
  └────────────────────────┴───────────────┘

Regardless, I will merge this PR to unblock Studio release and then continue working on #2502 which could speed site creation up.

@ivan-ottinger
ivan-ottinger merged commit b10c4c6 into trunk Feb 3, 2026
9 checks passed
@ivan-ottinger
ivan-ottinger deleted the revert/file-copy-logic branch February 3, 2026 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants