All Projects β†’ antirotor β†’ speedcopy

antirotor / speedcopy

Licence: Apache-2.0 license
Patched python shutil.copyfile to allow faster speeds on samba shares.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to speedcopy

Fcfilemanager
iOS File Manager on top of NSFileManager for simplifying files management. πŸ“‚
Stars: ✭ 862 (+6530.77%)
Mutual labels:  files, copy
copy
Copy files using glob patterns. Sync, async, promise or streams. (node.js utility)
Stars: ✭ 84 (+546.15%)
Mutual labels:  files, copy
Xcv
βœ‚οΈ Cut, Copy and Paste files with Bash
Stars: ✭ 144 (+1007.69%)
Mutual labels:  files, copy
Copy
Go copy directory recursively
Stars: ✭ 264 (+1930.77%)
Mutual labels:  files, copy
Copy Webpack Plugin
Copy files and directories with webpack
Stars: ✭ 2,679 (+20507.69%)
Mutual labels:  files, copy
files-io
Read many files with node
Stars: ✭ 19 (+46.15%)
Mutual labels:  files
vsc-material-theme-icons
Material Theme Icons, the most epic icons theme for Visual Studio Code and Material Theme.
Stars: ✭ 90 (+592.31%)
Mutual labels:  files
wp-quicklink
The WordPress plugin for quicklink. ⚑️ Faster subsequent page-loads by prefetching in-viewport links during idle time.
Stars: ✭ 61 (+369.23%)
Mutual labels:  speed
copy-pasta
Universal copy paste service, works across different machines!
Stars: ✭ 49 (+276.92%)
Mutual labels:  copy
ucsunivention
⚫ Curso GRÁTIS SAMBA-4 UCS Univention Core Free 5.x Domain Controller Active Directory Open Source
Stars: ✭ 29 (+123.08%)
Mutual labels:  samba
washer
A whoosh-based CLI indexer and searcher for your files.
Stars: ✭ 16 (+23.08%)
Mutual labels:  files
FileOrganizer
Automatically organizes files in your computer
Stars: ✭ 34 (+161.54%)
Mutual labels:  files
github-action-scp
⬆️ Copy a folder to a remote server using SSH
Stars: ✭ 123 (+846.15%)
Mutual labels:  copy
speed-cloudflare-cli
πŸ“ˆ Measure the speed and consistency of your internet connection using speed.cloudflare.com
Stars: ✭ 99 (+661.54%)
Mutual labels:  speed
smbaudit
Perform various SMB-related attacks, particularly useful for testing large Active Directory environments.
Stars: ✭ 31 (+138.46%)
Mutual labels:  samba
v-copy
Vue directive to copy to clipboard. (1kB)
Stars: ✭ 88 (+576.92%)
Mutual labels:  copy
nucked-truth-of-files
HollyJS Moscow
Stars: ✭ 14 (+7.69%)
Mutual labels:  files
file2html
JS convertor of files to HTML and CSS code
Stars: ✭ 29 (+123.08%)
Mutual labels:  files
upload
How to Upload a File to a Server in PHP
Stars: ✭ 83 (+538.46%)
Mutual labels:  files
vtex-cms-sauce
VTEX package for handling CMS requests.
Stars: ✭ 25 (+92.31%)
Mutual labels:  files

speedcopy

Build Status PyPI version

Patched python shutil.copyfile using native call CopyFile2 on windows to accelerate transfer on windows shares. On Linux, it issues special ioctl command CIFS_IOC_COPYCHUNK_FILE to enable server-side copy.

This works only when both source and destination files are on same SMB1(CIFS)/2/3 filesystem.

See https://wiki.samba.org/index.php/Server-Side_Copy

Installation

Add speedcopy to PYTHONPATH or:

pip install speedcopy

Usage

If you want to monkeypatch shutil.copyfile() then:

import shutil
import speedcopy

speedcopy.patch_copyfile()

# your code ...
shutil.copyfile(src, dst)

This will make last call to use speedcopy.

Direct use:

import speedcopy

# some code ...

speedcopy.copyfile(src, dst)

There is also debug mode enabled by setting speedcopy.SPEEDCOPY_DEBUG = True. This will print more information during runtime.

Benchmark

Windows

Filesize Python Speedcopy Factor
1 0.0797 0.0222 3.59
2 0.1702 0.0254 6.69
4 0.3257 0.0271 12.01
8 0.6729 0.0337 19.94
16 1.335 0.0384 34.72
32 2.3612 0.0625 37.72
64 57.4549 0.9758 58.88
128 10.9294 0.1669 65.47
256 20.3843 2.276 8.96
512 35.9462 3.9966 8.99
1024 65.6285 28.0291 2.34

Linux

Filesize Python Speedcopy Factor
1 0.0682 0.0099 6.88
2 0.0894 0.0105 8.51
4 0.1337 0.012 11.14
8 0.1922 0.0145 13.25
16 0.2853 0.0193 14.78
32 0.4724 0.0288 16.4
64 8.0071 0.4724 16.94
128 1.3338 0.2311 5.77
256 2.6599 0.4788 5.55
512 5.3798 0.9796 5.49
1024 10.3328 2.9180 3.54

Note that Windows and Linux timing do not correlate, they are taken from different systems. Notice the spike on 64 Mb size file on both of them. Also note that these figures are not taken from production grade hardware and setup and can be completely off at other places.

You can test it yourself with included benchmark.py (and this will take some time as values are measured multiple times and then averaged).

Todo

  • Better error handling
  • Other platforms support
  • Conform behaviour to original shutil.copyfile()
  • Review benchmark code
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].