Skip to content

An experimental Elixir redis library with the speed of hiredis

Notifications You must be signed in to change notification settings

ismaelga/hirelix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hirelix

** WARNING: Broken software ahead... **

This is just an experiment on using hiredis on Elixir.

It's a kinda of an extension to exredis to get the speed of hiredis using erlang bindings for it (hierdis).

To use it you have to add it to your project dependencies.

{:exredis, github: "artemeff/exredis", tag: "0.1.0"},
{:hirelix, github: "ismaelga/hirelix"}

Then replace use Exredis with use Hirelix

defmodule Pi do
  use Exredis

  def get, do: start |> query ["GET", "Pi"]
  def set, do: start |> query ["SET", "Pi", "3.14"]
end

would become

defmodule Pi do
  use Hirelix

  def get, do: start |> query ["GET", "Pi"]
  def set, do: start |> query ["SET", "Pi", "3.14"]
end

Some benchmark results for the get command

$ hirelix ❯ mix bench
Settings:
  duration:      1.0 s
  mem stats:     false
  sys mem stats: false

[18:39:10] 1/2: GetBench.get Hirelix
[18:39:12] 2/2: GetBench.get Exredis
Finished in 9.68 seconds

GetBench.get Hirelix:      10000   225.88 µs/op
GetBench.get Exredis:       2000   3153.39 µs/op

About

An experimental Elixir redis library with the speed of hiredis

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages