Skip to content

Performance: Parallelize recursive directory copying without fs-copy - #2502

Merged
ivan-ottinger merged 2 commits into
trunkfrom
update/file-copy
Feb 9, 2026
Merged

Performance: Parallelize recursive directory copying without fs-copy#2502
ivan-ottinger merged 2 commits into
trunkfrom
update/file-copy

Conversation

@ivan-ottinger

@ivan-ottinger ivan-ottinger commented Jan 29, 2026

Copy link
Copy Markdown
Contributor

Related issues

Proposed Changes

  • parallelize recursive directory copying

Related discussion: #2409 (comment)

Here are the performance test results - comparing current trunk with this branch:

  Site Creation Time on macOS (7 rounds)
  ┌────────┬─────────┬──────────────────┐
  │ Round  │  trunk  │ update/file-copy │
  ├────────┼─────────┼──────────────────┤
  │ 1      │ 7042 ms │ 6046 ms          │
  ├────────┼─────────┼──────────────────┤
  │ 2      │ 7040 ms │ 7032 ms          │
  ├────────┼─────────┼──────────────────┤
  │ 3      │ 7058 ms │ 6030 ms          │
  ├────────┼─────────┼──────────────────┤
  │ 4      │ 7050 ms │ 7040 ms          │
  ├────────┼─────────┼──────────────────┤
  │ 5      │ 8098 ms │ 7056 ms          │
  ├────────┼─────────┼──────────────────┤
  │ 6      │ 7051 ms │ 6041 ms          │
  ├────────┼─────────┼──────────────────┤
  │ 7      │ 7037 ms │ 6047 ms          │
  ├────────┼─────────┼──────────────────┤
  │ Median │ 7050 ms │ 6047 ms          │
  └────────┴─────────┴──────────────────┘
That is a -1003 ms (14.2% faster) improvement over current trunk.


 Site Creation Time on Windows via Parallels (5 rounds - as it took quite a long time, I decided to skip two rounds)
  ┌────────┬───────────┬──────────────────┐
  │ Round  │   trunk   │ update/file-copy │
  ├────────┼───────────┼──────────────────┤
  │ 1      │ 34,618 ms │ 32,651 ms        │
  ├────────┼───────────┼──────────────────┤
  │ 2      │ 32,572 ms │ 30,629 ms        │
  ├────────┼───────────┼──────────────────┤
  │ 3      │ 31,623 ms │ 31,652 ms        │
  ├────────┼───────────┼──────────────────┤
  │ 4      │ 32,639 ms │ 31,537 ms        │
  ├────────┼───────────┼──────────────────┤
  │ 5      │ 31,518 ms │ 31,624 ms        │
  ├────────┼───────────┼──────────────────┤
  │ Median │ 32,572 ms │ 31,624 ms        │
  └────────┴───────────┴──────────────────┘
That is a -948 ms (2.9% faster) improvement over current trunk.

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.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
@ivan-ottinger ivan-ottinger self-assigned this Jan 29, 2026
@ivan-ottinger ivan-ottinger changed the title Use parallel file copy Jan 29, 2026
@ivan-ottinger
ivan-ottinger marked this pull request as ready for review February 3, 2026 08:58
@ivan-ottinger
ivan-ottinger marked this pull request as draft February 3, 2026 10:59
@ivan-ottinger
ivan-ottinger force-pushed the update/file-copy branch 2 times, most recently from 7a7301e to 19f1d00 Compare February 4, 2026 10:27
@ivan-ottinger
ivan-ottinger marked this pull request as ready for review February 4, 2026 12:23
@ivan-ottinger
ivan-ottinger requested a review from a team February 4, 2026 12:23

@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 following up on this! I tested it and found no issues. I also tested it on Windows and noticed slightly better performance. The changes look good to me! :shipit:

@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.

Nice improvement. Step by step we can make Studio run faster.

@wojtekn

wojtekn commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

@ivan-ottinger do you know what caused performance downgrade after merging previous PR?

@ivan-ottinger

Copy link
Copy Markdown
Contributor Author

@ivan-ottinger do you know what caused performance downgrade after merging previous PR?

Hey Wojtek 👋🏼 You mean this one (#2409), right? It is not clear - because when we reverted the change in #2520, the tests did not observe any change in performance.

I think it could have been related to that specific performance tests run recorded for that PR. Longer time could have been due to some other factors. Because of that, I run multiple rounds which I shared in this PR description where the median shows clear improvement in the copy approach introduced in this PR.

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

Labels

None yet

4 participants