Comments (15)
Did some profiling and a quick patch with: https://github.com/teepark/python-lzf resulting in x2 performance boost.
from redis-rdb-tools.
@yoav-steinberg : Thanks for taking time to investigate this issue!
I don't like adding a dependency to the project. Let me investigate if there is a way to conditionally include the library, so that people who don't want to install the dependency can still use rdb-tools.
from redis-rdb-tools.
You can also consider including the c files from the liblzf directly in redis-rdb-tools instead of adding a dependency. It is fairly common to have liblzf files included inside a larger project (actually redis does this!).
from redis-rdb-tools.
Simplistic patch here: https://github.com/jvtm/redis-rdb-tools/tree/lzf-speedup
Not creating a pull request just yet, I want to test this with real fresh dumps first. The related unit tests pass, but I didn't check if error reporting on invalid values behaves the same.
from redis-rdb-tools.
@sripathikrishnan any thoughts on including @jvtm's patch? It doesn't require python-lzf, but uses it if its there.
from redis-rdb-tools.
bump. Any chance on getting this? Parsing a 10g backup for me is brutal.
from redis-rdb-tools.
Wow, didn't even remember this one... Not working anymore on the project where this was required. Here's the exact tiny commit: jvtm@fdd8134 (failed to include this issue in commit message)
from redis-rdb-tools.
I dug around the code and noticed this commit introduced the lzf optimization.
from redis-rdb-tools.
@billcrook the current code only uses the lzf optimization if you have the native library installed. maybe you just need to do pip install lzf
?
does the commit @jvtm mentioned changes anything? seem to me that it does the same thing the current version already does. please let me know if i'm missing anything.
from redis-rdb-tools.
@billcrook the current code only uses the lzf optimization if you have the native library installed. maybe you just need to do
pip install lzf
?
You mean python-lzf
, right?
does the commit @jvtm mentioned changes anything? seem to me that it does the same thing the current version already does. please let me know if i'm missing anything.
You are correct. It seems to do the same check for existence of lzf module.
from redis-rdb-tools.
@billcrook no, not python-lzf
that's the python re-implementation.
the fast one, which we rather use is just lzf
which are python bindings to the C implementation.
from redis-rdb-tools.
Are you sure about that? When I remove python-lzf
and install lzf
I get:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 13, in parse
File "/Users/billcrook/dev/audiomack/data-pipeline/venv/lib/python3.6/site-packages/rdbtools/parser.py", line 461, in parse_fd
self.read_object(f, data_type)
File "/Users/billcrook/dev/audiomack/data-pipeline/venv/lib/python3.6/site-packages/rdbtools/parser.py", line 569, in read_object
value = self.read_string(f)
File "/Users/billcrook/dev/audiomack/data-pipeline/venv/lib/python3.6/site-packages/rdbtools/parser.py", line 508, in read_string
val = self.lzf_decompress(f.read(clen), l)
File "/Users/billcrook/dev/audiomack/data-pipeline/venv/lib/python3.6/site-packages/rdbtools/parser.py", line 1021, in lzf_decompress
return lzf.decompress(compressed, expected_length)
AttributeError: module 'lzf' has no attribute 'decompress
from redis-rdb-tools.
For reference: #110 (comment)
from redis-rdb-tools.
@billcrook sorry, it seems that i was wrong.. python-lzf
is the one that's native, and redis-rdb-tools has no use of the lzf
library.
maybe @galcohen-redislabs can provide some insight or spot a regression.
from redis-rdb-tools.
@billcrook Please provide some rough numbers on the rdb file:
Number of keys, average value size, time it takes to rdb --command json
it.
from redis-rdb-tools.
Related Issues (20)
- rdb -c memory , Throw an exception: "pkg_resources.DistributionNotFound: redis" HOT 2
- rdb -c memory dump.rdb --bytes 128 -f redis.csv HOT 1
- how to speed up the rdb parse process HOT 3
- question: how to restore redis 3.0.6 with redis 4.0's dump.rdb ?
- error:parser.parse(options.dump_file[0])
- Support RedisTimeSeries data format
- redis6 is or not support?
- Invalid export of large files
- verison ?
- What versions of Python and python-lzf are supported? HOT 2
- Could not find suitable distribution for Requirement.parse('redis') HOT 1
- Missing data
- how to see rdb-tools log? HOT 4
- Redis 7 Support HOT 7
- Invalid RDB version number 10 HOT 13
- Maintained HOT 2
- redis-memory-for-key not work for redis cluster HOT 2
- Q) How to save converted json file? HOT 3
- Bloom Filter Dump restore failing HOT 2
- datetime.datetime.utcfromtimestamp HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redis-rdb-tools.