Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
juerg committed Dec 18, 2023
1 parent 65aa415 commit 710c27b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
19 changes: 7 additions & 12 deletions doc/examples/scripts/aes-speed.venice
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,7 @@
(if (< size-kb 1000) (str size-kb "KB") (str (/ size-kb 1000) "MB")))

(defn identical [file1 file2]
(= (io/slurp file1 :binary true)
(io/slurp file2 :binary true)))

(defn printel [title elapsed]
(printf "%-21s %4dms%n" title elapsed))
(= (io/slurp file1 :binary true) (io/slurp file2 :binary true)))

(defn encrypt [algo passphrase file-in file-out]
(crypt/encrypt-file algo passphrase file-in file-out))
Expand Down Expand Up @@ -186,10 +182,9 @@
:body {:align :right}
:width 6)
samples))]

(as-> (map #(run %) samples) data
(m/transpose data)
(map vector sections data) ;; insert section column at col 0
(map #(cons (first %) (second %)) data)
(ascii-table/render columns data :bold-no-data 1)
(println data)))))
(as-> (map #(run %) samples) data
(m/transpose data)
(map vector sections data) ;; insert section column at col 0
(map #(cons (first %) (second %)) data)
(ascii-table/render columns data :bold-no-data 1)
(println data)))))
12 changes: 6 additions & 6 deletions doc/examples/scripts/hash-speed.venice
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@
:body {:align :right}
:width 6)
samples))]
(as-> (map #(run % algorithms) samples) data
(m/transpose data)
(map vector sections data) ;; insert section column at col 0
(map #(cons (first %) (second %)) data)
(ascii-table/render columns data :bold-no-data 1)
(println data)))))
(as-> (map #(run % algorithms) samples) data
(m/transpose data)
(map vector sections data) ;; insert section column at col 0
(map #(cons (first %) (second %)) data)
(ascii-table/render columns data :bold-no-data 1)
(println data)))))

0 comments on commit 710c27b

Please sign in to comment.