{"id":13750634,"url":"https://github.com/matsumotory/mruby-vedis","last_synced_at":"2025-04-30T08:24:45.869Z","repository":{"id":11733819,"uuid":"14259173","full_name":"matsumotory/mruby-vedis","owner":"matsumotory","description":"vedis binding by mruby","archived":false,"fork":false,"pushed_at":"2023-02-23T13:53:52.000Z","size":202,"stargazers_count":34,"open_issues_count":3,"forks_count":9,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-10-18T18:17:03.593Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matsumotory.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2013-11-09T15:14:28.000Z","updated_at":"2022-03-19T15:53:18.000Z","dependencies_parsed_at":"2024-02-04T21:08:08.125Z","dependency_job_id":"aaba911b-501c-46d1-91a5-33c076d7ae7e","html_url":"https://github.com/matsumotory/mruby-vedis","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matsumotory%2Fmruby-vedis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matsumotory%2Fmruby-vedis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matsumotory%2Fmruby-vedis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matsumotory%2Fmruby-vedis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matsumotory","download_url":"https://codeload.github.com/matsumotory/mruby-vedis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251667551,"owners_count":21624522,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T08:00:43.162Z","updated_at":"2025-04-30T08:24:45.830Z","avatar_url":"https://github.com/matsumotory.png","language":"C","funding_links":[],"categories":["Database"],"sub_categories":[],"readme":"# mruby-vedis   [![Build Status](https://travis-ci.org/matsumoto-r/mruby-vedis.png?branch=master)](https://travis-ci.org/matsumoto-r/mruby-vedis)\nBinding vedis for mruby.\n\nVedis is a embeddable datastore and self-contained C library that supports over 70 commands similar to Redis.\n\nThe major difference from Redis is no networking layer since Vedis runs in the same process of the host application.\n\nPlease see the official [Vedis homepage](http://vedis.symisc.net/index.html) for more detail.\n\n## Install by mrbgems\n\nAdd the following line to `build_config.rb`:\n\n```ruby\nMRuby::Build.new do |conf|\n\n    # ... (snip) ...\n\n    conf.gem :github =\u003e 'matsumoto-r/mruby-vedis'\nend\n```\n\n## Usage\n\n```ruby\n# In-Memory\nv = Vedis.new\n\n# On-Disk\n# v = Vedis.new \"/path/to/vedis.db\"\n\n# sym ok\nv[\"test\"] = \"bbb\"\nv[:hoge] = 2\nv[:foo] = 3\nv.set :fuga, \"aaa\"\n\n# exec\nr1 = v.exec \"MSET username james age 27 mail dude@example.com\"\nr2 = v.exec \"MGET username age mail\"\n\np v[\"test\"]     #=\u003e \"bbb\"\np v[:hoge]      #=\u003e \"2\"\np v[\"foo\"]      #=\u003e \"3\"\np v.get :fuga   #=\u003e \"aaa\"\np r1            #=\u003e nil\np r2            #=\u003e [\"james\", \"27\", \"dude@example.com\"]\n```\n\n## Benchmark comparing Vedis with Redis\n\n### Simple benchmark\n\n```ruby\nclass SimpleBenchmark\n\n  def initialize(width = 0)\n    @width = width\n  end\n\n  def measure(label)\n    start = Time.now\n    yield if block_given?\n    passed = Time.now - start\n\n    puts \"#{make_fixed_label(label)}passed time #{passed} sec\"\n  end\n\n  def make_fixed_label(label)\n   if @width - label.length \u003e 0\n      label + ' ' * (@width - label.length)\n    else\n      label\n    end\n  end\n\nend\n\nbenchmark = SimpleBenchmark.new\nr = Redis.new \"127.0.0.1\", 6379\nv = Vedis.new\nn = 100000\n\n[r, v].each do |kvs|\n  benchmark.measure(\"#{kvs.class}: \") do\n    n.times do |t|\n      kvs.set t.to_s, t.to_s\n    end\n  end\nend\n\nr.close\nv.close\n```\n\n### Results\n\n```bash\n$ mruby test_vedis_redis.rb\nRedis: passed time 10.785598 sec\nVedis: passed time 0.06595 sec\n```\n\n## License\n\nmruby-vedis is licensed under the Sleepycat License, see the LICENSE file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatsumotory%2Fmruby-vedis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatsumotory%2Fmruby-vedis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatsumotory%2Fmruby-vedis/lists"}