Skip to content

Utilize fs.copyFileSync if available. - #41

Open
stefanpenner wants to merge 1 commit into
masterfrom
fs-copy-sync
Open

Utilize fs.copyFileSync if available.#41
stefanpenner wants to merge 1 commit into
masterfrom
fs-copy-sync

Conversation

@stefanpenner

@stefanpenner stefanpenner commented Jul 27, 2018

Copy link
Copy Markdown
Contributor

Although node-copy-file-sync module exists, it uses more modern JS features. Which this library cannot yet support (without major version bump)

[fixes #34]

@stefanpenner

stefanpenner commented Jul 27, 2018

Copy link
Copy Markdown
Contributor Author

@kanongil / @kellyselden / @lifeart et.al got any cycles to give this a try? See if this helps windows perf.

* Currently would only be utilized on windows
* available in node 8.5.x
* prefer Copy-On-Write if available
* good benchmarks yarnpkg/yarn#3290

Although node-copy-file-sync module exists, it uses more modern JS features. Which this library cannot yet support (without major version bump)
@kellyselden

Copy link
Copy Markdown

Sure. What would be the best way to test this other than running the test suite?

@stefanpenner

stefanpenner commented Jul 31, 2018

Copy link
Copy Markdown
Contributor Author

@kellyselden

  • on a current checkout
  • run cold build and share the times
  • run rebuild and share the times
  • then update all copies of symlink-or-copy in your node_modules
  • disable symlinks
  • run cold build and share the times
  • run rebuild and share the times

I'll also try to put together some benchmarks this week.

@lifeart

lifeart commented Aug 2, 2018

Copy link
Copy Markdown
Contributor

@stefanpenner

no-symlink node 10 win 8.1

old first build 56337ms
old first build 47514ms
old first build 46859ms
old rebuild 15407ms
old rebuild 11573ms
old rebuild 11350ms

new first build  48338ms
new first build  51485ms
new first build  47898ms
new rebuild  12211ms
new rebuild  10830ms
new rebuild  11595ms


using-symlink node 10 win 8.1

old first build 37375ms
old first build 37517ms
old first build 36819ms
old rebuild 8208ms
old rebuild 8419ms
old rebuild 7828ms

new first build  36811ms
new first build  36631ms
new first build  36289ms
new rebuild  8514ms
new rebuild  8451ms
new rebuild  8617ms


@lifeart

lifeart commented Aug 2, 2018

Copy link
Copy Markdown
Contributor

Master Branch

Tests failing without symlinks
image

Using symlinks - ok

image

FS-COPY-SYNC Branch

without symlinks

image

Using symlinks
image

@stefanpenner

Copy link
Copy Markdown
Contributor Author

I'll have to re-test this on new versions of OSX, but when tested last time it was a wash or worse for smallish files.

It may be the case that we perform the operation based on curtain heuristics?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use fs.copyFile() api in node 8.5+

3 participants