<commit_before>(ns transit.test
  (:require [transit.core :as t]
            [cljs.reader :as r]))

(enable-console-print!)

(def fs (js/require "fs"))
(def json (. fs (readFileSync "../transit/seattle-data0.tjs" "utf8")))
(def r (t/reader :json))

(println "100 iters, transit read seattle file")
(println (. r (read json)))
(time
  (dotimes [_ 100]
    (. r (read json))))

(println "10 iters, cljs.reader/read-string seattle file")
(def edn (pr-str (. r (read json))))
(time
  (dotimes [_ 10]
    (r/read-string edn)))<commit_msg>add timings for JSON.parse of seattle file<commit_after>(ns transit.test
  (:require [transit.core :as t]
            [cljs.reader :as r]))

(enable-console-print!)

(def fs (js/require "fs"))
(def json (. fs (readFileSync "../transit/seattle-data0.tjs" "utf8")))
(def r (t/reader :json))

(println "100 iters, transit read seattle file")
(println (. r (read json)))
(time
  (dotimes [_ 100]
    (.read r json)))

(println "100 iters, JSON.parse seattle file")
(time
  (dotimes [_ 100]
    (.parse js/JSON json)))

(println "10 iters, cljs.reader/read-string seattle file")
(def edn (pr-str (. r (read json))))
(time
  (dotimes [_ 10]
    (r/read-string edn)))
{'fraction_non_alphanumeric': 0.18524727577535624, 'fraction_numerical': 0.025146689019279127, 'mean_word_length': 3.5572519083969465, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2848931', 'n_tokens_mistral': 477, 'n_tokens_neox': 439, 'n_words': 133}