danishprakash / py-splice Goto Github PK
View Code? Open in Web Editor NEWA Python interface to splice(2) system call
License: GNU General Public License v3.0
A Python interface to splice(2) system call
License: GNU General Public License v3.0
You use 1 page size buffer for each splice call. Its fine if second splice (to pipe) allows kernel to just mark memory pages as pagecache (thus, its fast). But fails if underiying pip is slow. For example if it belongs to file opened with O_DIRECT.
Simple test to splice data between 1GB files opened with O_DIRECT each:
(2 x SATA3 RAID0 ssd)
4k buf_size (your default): 60.67s 17MiB/s
64k buf size: 13.17s 78MiB/s
256k buf size: 9.05s 113MiB/s
1024k buf size: 5.46s 188MiB/s
4096k buf size: 3.80s 270MiB/s
8192k buf size: 3.16s 325MiB/s
What did I do above:
buf_size
accrordingly for each runfcntl F_SETPIPE_SZ
) for same value as buf_size
Pipe buf is 64k by default in modern linux. Everything above 1M requires CAP_SYS_RESOURCE
non-root users. 8M is maximum I was able to test, everything above returns ENOMEM for root.
Thanks!
subj:
Line 132 in 50bb8dd
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.