Permalink
Browse files

Update iota.clj

Removed commented out test code from iota.clj
  • Loading branch information...
1 parent 40c128e commit 3948b5f0b778f33fc37f17f4fe97d27adf53f02e @thebusby committed Sep 14, 2013
Showing with 0 additions and 164 deletions.
  1. +0 −164 src/clj/iota.clj
View
@@ -101,167 +101,3 @@
(coll-fold
[v n combinef reducef]
(foldseq v n combinef reducef)))
-
-
-
-
-
-(defn fold-into-vec
- "Provided a reducer, concatenate into a vector.
- Note: same as (into [] coll), but parallel."
- ([coll] (r/fold (r/monoid into vector) conj coll))
- ([n coll] (r/fold n (r/monoid into vector) conj coll)))
-
-(comment
-;; start of comments
-
-
-
-
-(time (let [foo (FileSeq. "/tmp/album.tsv" (int 10) (byte 10))]
- (->> foo
- rest
- (r/map (fn [^String s] (.split s "[\\t]" -1)))
- (r/map first)
- fold-into-vec ((juxt count #(take 10 %))))))
-
-
-(time (let [foo (FileSeq. "/tmp/album.tsv" (int 10) (byte 10))]
- (->> foo
- rest
- (r/map (fn [^String s] (.split s "[\\t]" -1)))
- (r/map first)
- fold-into-vec ((juxt count last)))))
-
-
-(def foo (FileSeq. "/tmp/album.tsv" (int 10) (byte 10)))
-
-(.mapchr foo 763 7790 (byte 10) -3)
-
-(defn mget [foo start end]
- (let [len (- end start)
- buf (byte-array len)
- ^iota.Mmap map (.map foo)]
- (.get map buf start (int len))
- (java.lang.String. buf (int 0) (int len) "UTF-8")))
-
-(.get mmap ba 0 (dec (count ba)))
-
-
-
-(.mapchr foo 763 7790 (byte 10) -3)
-;; 1109
-
-
-(import [iota Mmap])
-
-(def album-filename "/data/tsvs/album.tsv")
-
-(def fs (FileSeq. "/tmp/data.txt"))
-(def fs2 (FileSeq. "/tmp/data.txt"))
-(def fs3 (FileSeq. "/tmp/data.txt" (int 100) (byte 10)))
-
-
-(def foo (FileSeq. "/tmp/album.tsv" (int 100) (byte 10)))
-
-
-
-
-(time (->> foo
- rest
- (map (fn [^String s] (.split s "[\\t]" -1)))
- (map (comp #(Long/parseLong %) first))
- (reduce +)))
-
-(time (let [foo (FileSeq. "/tmp/album2.tsv")]
- (->> foo
- rest
- (r/map (fn [^String s] (.split s "[\\t]" -1)))
- (r/map (comp #(Long/parseLong %) first))
- (r/fold +))))
-
-(time (let [foo (FileSeq. "/tmp/album2.tsv" (int 100000) (byte 10))]
- (->> foo
- rest
- (r/map (fn [^String s] (.split s "[\\t]" -1)))
- (r/map (comp #(Long/parseLong %) first))
- (r/fold +))))
-
-(time (let [foo (FileSeq. "/tmp/album2.tsv")]
- (->> foo
- rest
- (r/map (fn [^String s] (.split s "[\\t]" -1)))
- (r/map (comp #(Long/parseLong %) first))
- (r/fold +))))
-
-(time (let [foo (vec "/tmp/album2.tsv")] ;; for comparison
- (->> foo
- rest
- (r/map (fn [^String s] (.split s "[\\t]" -1)))
- (r/map (comp #(Long/parseLong %) first))
- (r/fold +))))
-
-
-(time (let [foo (FileSeq. "/tmp/test2.tsv")]
- (->> foo
- rest
- (r/map (fn [^String s] (.split s "[\\t]" -1)))
- (r/map (comp #(Long/parseLong %) first))
- (r/fold +))))
-
-
-(time (let [foo (vec "/tmp/test2.tsv")] ;; for comparison
- (->> foo
- rest
- (r/map (fn [^String s] (.split s "[\\t]" -1)))
- (r/map (comp #(Long/parseLong %) first))
- (r/fold +))))
-
-
-(time (let [foo (FileSeq. "/tmp/album.tsv")]
- (->> foo
- rest
- (r/map (fn [^String s] (.split s "[\\t]" -1)))
- (r/map (comp #(Long/parseLong %) first))
- (r/fold +))))
-
-(time (def mmap (Mmap. album-filename)))
-
-
-(.size mmap)
-
-(def ba (byte-array 2000))
-
-(.get mmap ba 0 (dec (count ba)))
-
-
-(->> ba
- (partition-by #(= 10 %))
- first
- claas
-)
-
-(String. ba 0 (count ba) "UTF-8")
-
-(->> (count ba)
- range
- (take-while)
-)
-
-(range (count ba))
-
-
-;; -- All return ISeq
-;; first
-;; if start
-;; return until terminator
-;; else, return from terminator to next terminator
-;; next
-;; more
-;; cons
-
-
-
-
-;; end of comments
-)

0 comments on commit 3948b5f

Please sign in to comment.