Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defn -main []
- (with-open [reader (new BufferedReader (new FileReader "src/simple/10000000_20_10_50"))]
- (let [
- accounts (generate-accounts 10)
- agents (map-agents (take 2 (repeat 0)))
- expected_sum (reduce + 0 (map (fn [acct] @(:balance acct))
- (vals accounts)))]
- ; load transactions in ram
- (defn parse-and-process [trans]
- (process-transaction
- (parse-transaction trans 10)
- expected_sum
- accounts))
- ; Suddenly drops my cpu usage to 1% after running 10 sec
- ; (dorun (pmap parse-and-process (rest (line-seq reader))))
- ; works..
- (dorun (map parse-and-process (rest (line-seq reader))))
- )))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement