mrighele / zfs-find-deduped Goto Github PK
View Code? Open in Web Editor NEWGet a list of deduped files on a ZFS filesystem
License: MIT License
Get a list of deduped files on a ZFS filesystem
License: MIT License
zfs-find-deduped/zfs_find_deduped.py
Line 25 in 59d3773
zfs-find-deduped/zfs_find_deduped.py
Line 44 in 59d3773
These should probably be changed to use a streaming object, not split
.
AFAIK, split
will
a. block until it has its entire input (which is really huge on any real filesystem), and
b. then create the split array in memory (thereby doubling the already excessive RAM requirement).
Here, you just want to process it as a stream as fast as it comes in, since you´re not doing anything that requires the whole thing at once.
I don't know python well enough to suggest how to do it.
In Ruby, it'd be IO#gets
(which is also in anything descending from IO
, like File
).
In plain Bash it'd be
while IFS='$\n' read -r line
do
# do something with $line
done < process
zfs-find-deduped/zfs_find_deduped.py
Lines 52 to 56 in 59d3773
This should probably be reversed — there should be fewer dedup blocks than files, at least if you're only keeping ones where the block is used more than once — and then feed the resulting blocks-of-interest list to find_file_indirect_blocks
to use as a stream filter, i.e. so that files not on the list are ignored (& not kept in memory).
Fixing these two things should vastly improve the efficiency of the script.
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.