{"id":13611790,"url":"https://github.com/Svetlitski/fcp","last_synced_at":"2025-04-13T05:33:42.849Z","repository":{"id":43358147,"uuid":"329738613","full_name":"Svetlitski/fcp","owner":"Svetlitski","description":"A significantly faster alternative to the classic Unix cp(1) command, copying large files and directories in a fraction of the time.","archived":false,"fork":false,"pushed_at":"2023-04-25T08:42:27.000Z","size":850,"stargazers_count":728,"open_issues_count":13,"forks_count":17,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-05-12T11:04:22.052Z","etag":null,"topics":["cli","command-line","command-line-tool","fast","rust","unix"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Svetlitski.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-01-14T21:27:46.000Z","updated_at":"2024-05-11T04:12:40.000Z","dependencies_parsed_at":"2023-01-31T07:15:55.927Z","dependency_job_id":"4eea3901-41ab-464a-a606-92be71b5d7af","html_url":"https://github.com/Svetlitski/fcp","commit_stats":{"total_commits":117,"total_committers":3,"mean_commits":39.0,"dds":"0.017094017094017144","last_synced_commit":"6d5748701506d70d221c1250263cf141c2f9f272"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Svetlitski%2Ffcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Svetlitski%2Ffcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Svetlitski%2Ffcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Svetlitski%2Ffcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Svetlitski","download_url":"https://codeload.github.com/Svetlitski/fcp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248670513,"owners_count":21142896,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","command-line","command-line-tool","fast","rust","unix"],"created_at":"2024-08-01T19:02:08.395Z","updated_at":"2025-04-13T05:33:40.076Z","avatar_url":"https://github.com/Svetlitski.png","language":"Rust","funding_links":[],"categories":["Rust","cli","Other"],"sub_categories":[],"readme":"# fcp\n\n[![CI status](https://github.com/Svetlitski/fcp/actions/workflows/continuous_integration.yml/badge.svg?branch=master)](https://github.com/Svetlitski/fcp/actions/workflows/continuous_integration.yml)\n[![fcp crate](https://img.shields.io/crates/v/fcp.svg)](https://crates.io/crates/fcp)\n[![Packaging status](https://repology.org/badge/tiny-repos/fcp-faster-cp.svg)](https://repology.org/project/fcp-faster-cp/versions)\n\n\n`fcp` is a [significantly faster](#benchmarks) alternative to the classic Unix [`cp(1)`](https://man7.org/linux/man-pages/man1/cp.1.html) command.\n\n`fcp` aims to handle the most common use-cases of `cp` with much higher performance.\n\n`fcp` does _not_ aim to completely replace `cp` with its myriad options.\n\n**Note**: `fcp` is optimized for systems with an SSD. On systems with a HDD, `fcp` may exhibit poor performance.\n\n## Installation\n\nPlease note that `fcp` supports only Unix-like operating systems (e.g. Linux, macOS, etc.).\n\n### Pre-built binaries\n\nPre-built binaries for some systems can be found under [this repository's releases](https://github.com/Svetlitski/fcp/releases).\n\n### Via [`cargo`](https://github.com/rust-lang/cargo)\n\n`fcp` requires Rust version 1.53.0 or newer. `fcp` can be installed using `cargo` by running the following:\n\n```sh\ncargo install fcp\n```\n\n### Arch Linux\n\n`fcp` can be installed on Arch Linux via the [`fcp-bin` AUR](https://aur.archlinux.org/packages/fcp-bin/).\n\n### NixOS\n\nAs of NixOS 21.11 `fcp` is included in the stable channel. For earlier\nversions, `fcp` is available through `nixpkgs-unstable`. Assuming you've\nalready added the `nixpkgs-unstable` channel, `fcp` can be installed by running\nthe following:\n\n```sh\nnix-env -iA unstable.fcp\n```\n\n### macOS\n\n`fcp` can be installed on macOS via [Homebrew](https://brew.sh/) by running the following:\n\n```sh\nbrew install fcp\n```\n\n## Usage\n\nUsage information can be found by running `fcp --help`, and has been reproduced below:\n\n```\nfcp 0.2.1\n\nUSAGE:\n    fcp [OPTIONS] SOURCE DESTINATION_FILE\n    Copy SOURCE to DESTINATION_FILE, overwriting DESTINATION_FILE if it exists\n\n    fcp [OPTIONS] SOURCE ... DESTINATION_DIRECTORY\n    Copy each SOURCE into DESTINATION_DIRECTORY\n\nOPTIONS:\n    -h, --help\n            Output this usage information and exit.\n\n    -V, --version\n            Output version information and exit.\n```\n\n## Benchmarks\n\n`fcp` doesn't just _claim_ to be faster than `cp`, it _is_ faster than `cp`. As different operating systems display\ndifferent performance characteristics, the same benchmarks were run on both macOS and Linux.\n\n### macOS\n\nThe following benchmarks were run on a 2018 MacBook Pro\u003csup\u003e\u003ca href=\"#footnote-1\"\u003e1\u003c/a\u003e\u003c/sup\u003e (2.9 GHz 6-Core Intel Core i9, 16 GiB RAM, SSD) with [APFS](https://developer.apple.com/documentation/foundation/file_system/about_apple_file_system) as the filesystem.\n\n#### Large Files\n\nThe following shows the result of a benchmark which copies a directory containing 13 different 512 MB files using `cp` and `fcp`, with `fcp` being approximately **822x faster** on average (note the units of the axes for each plot)\u003csup\u003e\u003ca href=\"#footnote-2\"\u003e2\u003c/a\u003e\u003c/sup\u003e:\n\n![`fcp` is approximately 822x faster than `cp`, with `fcp`'s average time to copy being approximately 4.5 milliseconds, while `cp`'s average time to copy is approximately 3.7 seconds](https://user-images.githubusercontent.com/35482043/122131973-a3990080-cdff-11eb-92dc-3e0d5f47ac07.png)\n\n#### Linux Kernel Source\n\nThe following shows the result of a benchmark which copies the source tree of the Linux kernel using `cp` and `fcp`, with `fcp` being approximately 6x faster on average:\n\n![`fcp` is approximately 6x faster than `cp`, with `fcp`'s average time to copy being approximately 5.1 seconds, while `cp`'s average time to copy is approximately 30 seconds](https://user-images.githubusercontent.com/35482043/122131983-a7c51e00-cdff-11eb-8bbb-8c768998de56.png)\n\n### Linux\n\nThe following benchmarks were run on a bare-metal AWS EC2 instance (a1.metal, 16 CPUs, 32 GiB RAM, SSD) with [XFS](https://en.wikipedia.org/wiki/XFS) as the filesystem.\n\n#### Linux Kernel Source\n\nThe following shows the result of a benchmark which copies the source tree of the Linux kernel using `cp` and `fcp`, with `fcp` being approximately 10x faster on average:\n\n![`fcp` is nearly 10x faster than `cp`, with `fcp`'s average time to copy being approximately 675 milliseconds, while `cp`'s average time to copy is approximately 6.02 seconds](https://user-images.githubusercontent.com/35482043/122125946-ae9b6300-cdf6-11eb-97dd-0e0bfb916ede.png)\n\n#### Large Files\n\nThe following shows the result of a benchmark which copies a directory containing 13 different 512 MB files using `cp` and `fcp`, with `fcp` being approximately 1.4x faster on average:\n\n![`fcp` is approximately 1.4x faster than `cp, with `fcp`'s average time to copy being approximately 8 seconds, while `cp`'s average time to copy is approximately 11.3 seconds](https://user-images.githubusercontent.com/35482043/122125941-ae02cc80-cdf6-11eb-9899-a93ed0442f6f.png)\n\n\n## Methodology\n\n`fcp`'s high-performance can be attributed to several factors, but is primarily\nthe result of leveraging parallelism, distributing the work of walking\ndirectories and copying their contents across all of your machine's cores. This\nleads to a significant performance increase on systems with an SSD, as more I/O\nrequests are issued over the same period of time (as compared to a\nsingle-threaded approach), resulting in a higher-average queue depth, thus\nallowing higher utilization of the SSD (as a function of its maximum IOPS) and\ncorrespondingly higher throughput.\n\nAdditionally, on macOS (and perhaps in the future on other operating systems) `fcp`\nutilizes the system's underlying [copy-on-write](https://en.wikipedia.org/wiki/Copy-on-write)\ncapability, dramatically reducing the time needed to copy large files.\n\nThese two factors – in addition to an overall performance-conscious approach to this problem – serve\nto explain `fcp`'s significantly improved performance relative to `cp`.\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\n\u003cspan id=\"footnote-1\"\u003e[1]\u003c/span\u003e While in general [you should avoid benchmarking on\nlaptops](https://lemire.me/blog/my-sayings/), `fcp` is a developer tool and\nmany developers work primarily on laptops. Also unlike with Linux where you can\nrent by the second, the minimum tenancy for AWS EC2 macOS instances is 24\nhours, and these benchmarks took less than an hour.\n\n\u003cspan id=\"footnote-2\"\u003e[2]\u003c/span\u003e The massive difference in performance in this case is due\nto `fcp` using `fclonefileat` and `fcopyfile` under the hood.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSvetlitski%2Ffcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSvetlitski%2Ffcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSvetlitski%2Ffcp/lists"}