Last active
August 29, 2015 14:04
-
-
Save ducky427/be8c1803368ae91e636d to your computer and use it in GitHub Desktop.
Bulk create test using neocons
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns bulk-test.core | |
(:require [clojurewerkz.neocons.rest :as nr] | |
[clojurewerkz.neocons.rest.nodes :as nn] | |
[clojurewerkz.neocons.rest.cypher :as cy]) | |
(:gen-class)) | |
(defn create-nodes | |
[conn num] | |
(let [nodes (repeat num {:name "Joe Bloggs" :age 32})] | |
(nn/create-batch conn nodes))) | |
(def ^:const query "CREATE (n:Person { props } ) RETURN n") | |
(defn create-nodes-cypher | |
[conn num] | |
(let [nodes (repeat num {:name "Joe Bloggs" :age 32})] | |
(cy/tquery conn query {:props nodes}))) | |
(defn -main | |
[& args] | |
(let [conn (nr/connect "http://localhost:7474/db/data/")] | |
(time (create-nodes conn 80)) | |
(time (create-nodes conn 800)) | |
(time (create-nodes conn 800000)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment