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

Allow setting and scaning interface{} values. #118

Merged
merged 1 commit into from
Jul 11, 2015

Conversation

vmihailenco
Copy link
Collaborator

Should make client a little bit more convenient to use. @dim?

Fixes #121. Before

BenchmarkRedisBytes    10000        120101 ns/op       52809 B/op         16 allocs/op
BenchmarkRedisSet      30000         45606 ns/op       10666 B/op          7 allocs/op

After

BenchmarkRedisBytes    10000        108434 ns/op       32022 B/op         21 allocs/op
BenchmarkRedisSet      30000         46389 ns/op       10762 B/op         10 allocs/op

@vmihailenco
Copy link
Collaborator Author

@dim ping :) I am not worried about the code, but more about approach in general.

return "0", nil
}
default:
b, err := Marshal(vv)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably define a type Encodable interface { EncodeRedis() (string, error) } and return an error on default

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see #121 too

@dim dim mentioned this pull request Jun 5, 2015
@vmihailenco
Copy link
Collaborator Author

@dim PTAL

Before

BenchmarkRedisSet      30000         44599 ns/op       10666 B/op          7 allocs/op
BenchmarkRedisSetBytes     30000         51482 ns/op       21163 B/op          8 allocs/op
BenchmarkAppendArgs 10000000           155 ns/op           0 B/op          0 allocs/op

After

BenchmarkRedisSet      30000         45297 ns/op       10746 B/op         10 allocs/op
BenchmarkRedisSetBytes     30000         45215 ns/op       10762 B/op         10 allocs/op
BenchmarkAppendArgs 10000000           223 ns/op           0 B/op          0 allocs/op

@vmihailenco
Copy link
Collaborator Author

@dim ping

@dim
Copy link
Collaborator

dim commented Jun 16, 2015

Hey, sorry, I'm away until next week, but results look good

@vmihailenco
Copy link
Collaborator Author

Np, this can wait.

@vmihailenco
Copy link
Collaborator Author

@dim last time ping :)

@dim
Copy link
Collaborator

dim commented Jun 29, 2015 via email

vmihailenco added a commit that referenced this pull request Jul 11, 2015
Allow setting and scaning interface{} values.
@vmihailenco vmihailenco merged commit 39c9dc2 into master Jul 11, 2015
@vmihailenco vmihailenco deleted the feature/marshal-unmarshal branch July 11, 2015 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

String overhead
2 participants