Skip to content

Commit

Permalink
Move graalJS impl to dev, compare benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
zampino committed Aug 16, 2024
1 parent c464430 commit 55c5005
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bb.edn
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@
build:notebooks
{:doc "builds a Clerk static with notebooks specified in deps.edn given a specified git SHA"
:depends [cljs:sci:release]
:task (clojure (str "-X:nextjournal/clerk :git/sha '\"" (first *command-line-args*) "\"' :browse? false"))}
:task (clojure (str "-X:nextjournal/clerk :git/sha '\"" (or (first *command-line-args*) "SHASHASHA") "\"' :browse? false"))}

dev
{:doc "Boots and watches both shadow browser test and sci builds"
:depends [yarn-install]
:task (clojure "-M:test:nextjournal/clerk:sci watch sci browser-test")}
:task (clojure "-M:dev:test:nextjournal/clerk:sci watch sci browser-test")}

cljs:sci
{:doc "watches cljs build"
Expand Down
5 changes: 4 additions & 1 deletion deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

:aliases
{:nextjournal/clerk
{:extra-paths ["notebooks"]
{:extra-paths ["notebooks" "dev"]
:extra-deps {io.github.nextjournal/clerk {:git/sha "e8f275b5cf077ec9441e404c1885ff0b6ee0aef9"
:exclusions [io.github.nextjournal/markdown]}}
:jvm-opts ["-Dclojure.main.report=stderr"
Expand All @@ -50,6 +50,9 @@
:quiet
{:jvm-opts ["-Dpolyglot.engine.WarnInterpreterOnly=false"]}

:dev
{:extra-paths ["dev"]}

:test
{:extra-paths ["test"]
:jvm-opts ["-Dclojure.main.report=stderr"]
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions notebooks/benchmarks.clj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
[nextjournal.clerk :as clerk]
[nextjournal.clerk.eval :as clerk.eval]
[nextjournal.markdown :as md]
[nextjournal.markdown.graaljs :as old-md]
[nextjournal.markdown.utils :as u]
[parsing-extensibility]))

Expand All @@ -30,6 +31,11 @@
(time-ms (parse reference-text))
(time-ms (parse reference-text))]

;; GraalJS based implementation
[(time-ms (old-md/parse reference-text))
(time-ms (old-md/parse reference-text))
(time-ms (old-md/parse reference-text))]

;; With an extra brace-brace parser
(time-ms (parse [{:regex #"\{\{([^\{]+)\}\}"
:handler (fn [m] {:type :var :text (m 1)})}]
Expand Down

0 comments on commit 55c5005

Please sign in to comment.