Skip to content

Instantly share code, notes, and snippets.

View rust's full-sized avatar
🏢
Working from office

Shinichiro OGAWA rust

🏢
Working from office
View GitHub Profile
require 'benchmark'
require 'tokyocabinet'
require 'digest/sha1'
require 'pp'
bdb = TokyoCabinet::BDB.new
unless bdb.open("dbd-benchmark.dbd", TokyoCabinet::BDB::OWRITER | TokyoCabinet::BDB::OCREAT)
exit
end
require 'tokyotyrant'
include TokyoTyrant
# create the object
rdb = RDB::new
# connect to the server
if !rdb.open("localhost", 1978)
ecode = rdb.ecode
STDERR.printf("open error: %s\n", rdb.errmsg(ecode))
require 'tokyocabinet'
include TokyoCabinet
# create the object
hdb = HDB::new
# open the database
if(!hdb.open("casket.hdb", HDB::OWRITER | HDB::OCREAT))
ecode = hdb.ecode
STDERR.printf("open error: %s\n", hdb.errmsg(ecode))