-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
1,045 additions
and
1,685 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,23 @@ | ||
/bench/graphs | ||
/bench/snapshots | ||
/doc | ||
/ebin | ||
/deps | ||
/_build | ||
# The directory Mix will write compiled artifacts to. | ||
/_build/ | ||
|
||
# If you run "mix test --cover", coverage assets end up here. | ||
/cover/ | ||
|
||
# The directory Mix downloads your dependencies sources to. | ||
/deps/ | ||
|
||
# Where 3rd-party dependencies like ExDoc output generated docs. | ||
/doc/ | ||
|
||
# Ignore .fetch files in case you like to edit your project deps locally. | ||
/.fetch | ||
|
||
# If the VM crashes, it generates a dump, let's ignore it too. | ||
erl_crash.dump | ||
|
||
# Also ignore archive artifacts (built via "mix archive.build"). | ||
*.ez | ||
|
||
# OS | ||
.DS_Store | ||
Icon? | ||
# Ignore commands in text elixir format | ||
/priv/commands.exs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
Benchee.run(%{ | ||
"bitfield with all opts" => fn -> | ||
[ | ||
"BITFIELD", | ||
[" ", "key"], | ||
[" ", ["GET", " ", ["type", " ", "offset"]]], | ||
[" ", ["SET", " ", ["type", " ", "offset", " ", "value"]]], | ||
[" ", ["INCRBY", " ", ["type", " ", "offset", " ", "increment"]]], | ||
[" ", ["OVERFLOW", " ", "WRAP"]] | ||
] = | ||
Redis.bitfield("key", get: {"type", "offset"}, set: {"type", "offset", "value"}, | ||
incrby: {"type", "offset", "increment"}, overflow: :wrap) | ||
end, | ||
|
||
"georadius with opts as list" => fn -> | ||
[ | ||
"GEORADIUSBYMEMBER", | ||
[" ", "key"], | ||
[" ", "member"], | ||
[" ", "radius"], | ||
[" ", "km"], | ||
[" ", "WITHCOORD"], | ||
[" ", "WITHDIST"], | ||
[], | ||
[" ", ["COUNT", " ", "1"]], | ||
[" ", "ASC"], | ||
[], | ||
[] | ||
] = | ||
Redis.georadiusbymember("key", "member", "radius", :km, | ||
[:asc, :withdist, :withcoord, count: "1"]) | ||
end, | ||
|
||
"georadius with opts as keywords" => fn -> | ||
[ | ||
"GEORADIUSBYMEMBER", | ||
[" ", "key"], | ||
[" ", "member"], | ||
[" ", "radius"], | ||
[" ", "km"], | ||
[" ", "WITHCOORD"], | ||
[" ", "WITHDIST"], | ||
[], | ||
[" ", ["COUNT", " ", "1"]], | ||
[" ", "ASC"], | ||
[], | ||
[] | ||
] = | ||
Redis.georadiusbymember("key", "member", "radius", :km, | ||
[order: :asc, withdist: :withdist, withcoord: :withcoord, count: "1"]) | ||
end, | ||
|
||
"hmget" => fn -> | ||
["HMGET", [" ", "key"], [" ", ["field1", " ", "field2"]]] = | ||
Redis.hmget("key", ["field1", "field2"]) | ||
end, | ||
|
||
"hmset" => fn -> | ||
[ | ||
"HMSET", | ||
[" ", "key"], | ||
[" ", [["field1", " ", "value1"], " ", ["field2", " ", "value2"]]] | ||
] = | ||
Redis.hmset("key", [{"field1", "value1"}, {"field2", "value2"}]) | ||
end, | ||
|
||
"set" => fn -> | ||
["SET", [" ", "key"], [" ", "value"], [" ", ["PX", " ", "10000000"]], [" ", "XX"]] = | ||
Redis.set("key", "value", [:xx, expiration: {:px, 1_000_0000}]) | ||
end, | ||
|
||
}, time: 3, memory_time: 2, print: [fast_warning: false]) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.