Skip to content

Commit

Permalink
Updated README and TODO files.
Browse files Browse the repository at this point in the history
  • Loading branch information
gcv committed Dec 30, 2012
1 parent 3b46252 commit b88825f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 116 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -55,7 +55,7 @@ This example is available in `examples/examples/cupboard/simple.clj`.
## Dependencies

* Clojure 1.4.0
* Leiningen 1.7.0
* Leiningen



Expand Down
121 changes: 6 additions & 115 deletions TODO.org
@@ -1,118 +1,9 @@
* High priority improvements [0%]
- [ ] Full Clojure 1.4 support
+ use protocols instead of multimethods
+ use native keyword argument parsing
+ add defrecord type support (if possible)
+ use transients where garbage generation is high
- [ ] Read performance
(write-me (dments-seq 10000))
(read-me)
:note:
(ns cb-work
(:require [cupboard.bdb.je :as je]))


(def dments0
[["monhae" {:26 {:jovenatheart 1}}]
["itsgiohoffmann" {:19 {:xdowhatyoufearx 1},
:31 {:fevilanva 1},
:27 {:boogerminianii 1},
:32 {:mrgdebs 1},
:4 {:laix_x 1},
:3 {:luandroid420 1},
:2 {:mmrosati 1},
:10 {:danilloblizzard 1},
:12 {:boogerminianii 1}}]
["hollyhoodstar" {:24 {:fucg 1, :iamyejide 1},
:28 {:owwshanna2fly 1},
:26 {:prettylikeace 1, :abbeydaqueen 1},
:32 {:prettylikeace 1},
:33 {:hollyhoodstar 1},
:11 {:tunacheckers 1, :prettylikeace 1, :evedancer17 1},
:14 {:therealmsmonroe 2},
:18 {:amexcenturion 1, :mechanicalgirly 3},
:15 {:cassanova86 1}}]])


(def dments1
[["monhae" [1 {:26 {:jovenatheart 1}}]]
["itsgiohoffmann" [2 {:19 {:xdowhatyoufearx 1},
:31 {:fevilanva 1},
:27 {:boogerminianii 1},
:32 {:mrgdebs 1},
:4 {:laix_x 1},
:3 {:luandroid420 1},
:2 {:mmrosati 1},
:10 {:danilloblizzard 1},
:12 {:boogerminianii 1}}]]
["hollyhoodstar" [3 {:24 {:fucg 1, :iamyejide 1},
:28 {:owwshanna2fly 1},
:26 {:prettylikeace 1, :abbeydaqueen 1},
:32 {:prettylikeace 1},
:33 {:hollyhoodstar 1},
:11 {:tunacheckers 1, :prettylikeace 1, :evedancer17 1},
:14 {:therealmsmonroe 2},
:18 {:amexcenturion 1, :mechanicalgirly 3},
:15 {:cassanova86 1}}]]])


;; individual entries
(defn write-me [dments]
(je/with-db-env [e "/tmp/my-db" :allow-create true]
(je/with-db [db e "db" :allow-create true]
(doseq [[k v] dments]
(je/db-put db k v)))))


;; individual entries
(defn read-me []
(je/with-db-env [e "/tmp/my-db" :allow-create false :read-only true]
(je/with-db [db e "db" :allow-create false :read-only true]
(je/with-db-cursor [c db]
(loop [res {}
[k v] (je/db-cursor-first c)]
(if (nil? k)
; res
nil
(recur (assoc res k v)
(je/db-cursor-next c))))))))


;; numbered individual entries
(defn write-me2 [dments]
(je/with-db-env [e "/tmp/my-db2" :allow-create true]
(je/with-db [db e "db" :allow-create true]
(je/with-db-sec [num-idx e db "num-idx" :allow-create true :key-creator-fn first]
(doseq [[k v] dments]
(je/db-put db k v))))))


;; numbered individual entries
(defn read-me2 []
(je/with-db-env [e "/tmp/my-db2" :allow-create false :read-only true]
(je/with-db [db e "db" :allow-create false :read-only true]
(je/with-db-sec [num-idx e db "num-idx" :allow-create false :read-only true
:key-creator-fn first]
(je/with-db-cursor [c num-idx]
(doall (je/db-cursor-scan c 2)))))))


(defn dments-seq [n]
(let [helper (fn helper []
(lazy-seq (cons [(.toString (java.util.UUID/randomUUID))
{:19 {:xdowhatyoufearx 1},
:31 {:fevilanva 1},
:27 {:boogerminianii 1},
:32 {:mrgdebs 1},
:4 {:laix_x 1},
:3 {:luandroid420 1},
:2 {:mmrosati 1},
:10 {:danilloblizzard 1},
:12 {:boogerminianii 1}}]
(helper))))]
(take n (helper))))
:end:
- [ ] Deadlock tests all fail
* High priority improvements
- use protocols instead of multimethods
- use native keyword argument parsing
- add defrecord type support (if possible)
- use transients where garbage generation is high
- investigate failing deadlock tests


* Future?
Expand Down

0 comments on commit b88825f

Please sign in to comment.