Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use dedicated string codecs on String connections and add ByteArrayCodec #70

Closed
mp911de opened this issue Jun 2, 2015 · 2 comments
Closed
Labels
type: feature A new feature
Milestone

Comments

@mp911de
Copy link
Collaborator

mp911de commented Jun 2, 2015

  • Provide byte[] codec
  • Use dedicated String codec when creating connections without a codec
@mp911de mp911de added the type: feature A new feature label Jun 2, 2015
@mp911de mp911de added this to the Lettuce 3.3 milestone Jun 2, 2015
mp911de added a commit that referenced this issue Jun 3, 2015
@mp911de mp911de closed this as completed Jun 3, 2015
@carlvine500
Copy link

performance will be better , codec will be done by user-thread insteadof netty-thread.

@mp911de
Copy link
Collaborator Author

mp911de commented Jun 4, 2015

It's a bit different. Performance depends on how the codec works internally.

If you work with one connection only (does not matter whether single- or multi-threaded), you won't notice a difference. The String encoding is non-blocking, the String decoding is blocking. But even this has very little effect, since Redis works mostly single-threaded. You'll get benefits if you connect to multiple Redis instances. Multiple connections won't share a codec and won't block each other.

The change is from share the String codec amongst the whole client to share the String codec amongst a logical connection. A logical connection is either a sync/async connection to Redis Standalone/Sentinel or a connection to a whole cluster. The cluster connection consists of multiple connections behind the scenes. So here the String codec is shared again among multiple physical Redis instances.

mp911de added a commit that referenced this issue Jun 4, 2015
mp911de added a commit that referenced this issue Jun 6, 2015
mp911de added a commit that referenced this issue Jun 9, 2015
mp911de added a commit that referenced this issue Jun 9, 2015
mp911de added a commit that referenced this issue Jun 9, 2015
@mp911de mp911de changed the title Improve codecs Use dedicated string codecs on String connections and add ByteArrayCodec Jul 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature A new feature
Projects
None yet
Development

No branches or pull requests

2 participants