Comments (5)
hello,
i did some work on "unpacking" snappy compressed messages in kafka-rust
and feel confident to provide an answer here.
first of all, kafka-rust
is bound to the format spilled out by SnappyOutputStream which is used at least by Kafka 0.8.2.x. this is basically a concatenation of snappy compressed blocks - unfortunately not snappy frames.
- so far i can see, we cannot use snappy_framed at the moment due to the format of the compressed data Kafka produces.
- snappy is a thin ffi wrapper around the c/c++ library which is exactly what
kafka-rust
does. in other words, with some minor changes this library could in fact be used as a drop-in replacement for the corresponding code in kafka-rust. however, in branch-0.2.x - hopefully to be released in a few weeks - i extended the core decompression function a little bit to avoid some extra copying. so far, i'm quite OK with the performance. however, such changes could be intergrated intosnappy
, of course. for me,snappy
looks like a good candidate. - i have not looked in detail at rsnappy yet, but right now it seems to me like it provides an API which would be suitable to us. the fact it's written in rust is indeed very interesting. i might have some experiments with it.
if you'd like to experiment yourself, feel free to go ahead and submit a pull request. for decompressing snappy messages we have unit tests as well as benchmarks (requires rust nightly) set up in master
as well as the already mentioned branch-0.2.x
.
from kafka-rust.
-
merely replacing the existing snappy decompression code in
kafka-rust
withrsnappy
leads to benchmarks indicating a performance loss by a factor of two to three on my machine. but it might well be i've not usedrsnappy
effectively. -
further it seems, that
rsnappy
is not very robust against invalid input data. -
i've pushed the changes to the
rsnappy
branch for the moment.
@veddan do you have any measurements comparing the performance of rsnappy
to https://github.com/google/snappy ?
from kafka-rust.
fyi: once JeffBelgum/rust-snappy#1 is merged and released, we'll switch over to that snappy
crate to get rid of our own snappy native bindings. the corresponding changes to kafka-rust are prepared in the external-snappy-dep
branch for the moment.
from kafka-rust.
Switched over to the snappy
crate with 930efc9. This change will be released as part of 0.2, since it requires an update of the libc dependency.
from kafka-rust.
just pushed version 0.2.0 to crates.io with a dependency on snappy:0.3.0
. feel free to re-open if there's anything left from your side.
from kafka-rust.
Related Issues (20)
- Fix test_commit_offsets test HOT 1
- Fix test_consumer_poll tests HOT 1
- Fix Integration Tests due to SSL certificate HOT 4
- Is there a way to reset the offset of a consumer group? HOT 7
- windows-gnu target compilation [Question] HOT 1
- "for ms in consumer.poll().unwrap().iter()" produces temporary value error HOT 3
- v0.8.0 is pointing to error-chain = "0.10" that is creating an error HOT 3
- [Feature request] Support for rebalancing and heartbeat HOT 8
- [Feature] Versions handling HOT 8
- How to get message timestamp HOT 2
- Consumers of the same group consuming same partitions and getting same messages HOT 1
- Sending message with headers HOT 2
- Version 0.9 HOT 2
- TLS max record size
- How to get the offset of the last message in a partition?
- is this repo being maintained? HOT 6
- Failed to debug from VSCode after added kafka client references. ("Unknown error (Open 'launch.json'" when F5)
- commit_consumed RequestTimedOut
- Consume from Latest
- UnknowTopicOrPartitiion Error
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 kafka-rust.