Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igrishaev/02e83bb3c6dad4a71ab58f1a54c04b0b to your computer and use it in GitHub Desktop.
Save igrishaev/02e83bb3c6dad4a71ab58f1a54c04b0b to your computer and use it in GitHub Desktop.
pg.migration
> (-> "https://raw.githubusercontent.com/InteractiveAdvertisingBureau/vast/master/vast4macros/data/macros-data.json"
java.net.URL.
slurp
pg.json/read-string
type
)
clojure.lang.PersistentHashMap
pg.migration
> (-> "https://raw.githubusercontent.com/InteractiveAdvertisingBureau/vast/master/vast4macros/data/macros-data.json"
java.net.URL.
slurp
pg.json/read-string
pg.json/write-string
count
)
42640
pg.migration
> (-> "https://raw.githubusercontent.com/InteractiveAdvertisingBureau/vast/master/vast4macros/data/macros-data.json"
java.net.URL.
slurp
pg.json/read-string
pg.json/write-string
pg.json/write-string
count
)
45823
pg.migration
> (/ 45823 42640)
45823/42640
pg.migration
> (/ 45823.0 42640)
1.0746482176360226
pg.migration
> (-> "https://raw.githubusercontent.com/json-iterator/test-data/master/large-file.json"
java.net.URL.
slurp
pg.json/read-string
pg.json/write-string
count
)
26087543
pg.migration
> (-> "https://raw.githubusercontent.com/json-iterator/test-data/master/large-file.json"
java.net.URL.
slurp
pg.json/read-string
pg.json/write-string
pg.json/write-string
count
)
28214969
pg.migration
> ( / 28214969.0 26087543)
1.0815494966313999
pg.migration
> (* 1.0815494966313999 5)
5.407747483156999
pg.migration
> (* 1.0815494966313999 5.545)
5.997191958821112
pg.migration
> (-> {:foo {:bar [:a :b :c]}} pg.json/write-string)
"{\"foo\":{\"bar\":[\"a\",\"b\",\"c\"]}}"
pg.migration
> (-> {:foo {:bar [:a :b :c]}} pg.json/write-string println)
{"foo":{"bar":["a","b","c"]}}
nil
pg.migration
> (-> {:foo {:bar [:a :b :c]}} pg.json/write-string pg.json/write-string println)
"{\"foo\":{\"bar\":[\"a\",\"b\",\"c\"]}}"
nil
pg.migration
> (-> "https://github.com/seductiveapps/largeJSON/raw/master/100mb.json"
java.net.URL.
slurp
pg.json/read-string
pg.json/write-string
count
)
60129867
pg.migration
> (-> "https://github.com/seductiveapps/largeJSON/raw/master/100mb.json"
java.net.URL.
slurp
pg.json/read-string
pg.json/write-string
pg.json/write-string
count
)
70361681
pg.migration
>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment