Skip to content

Commit

Permalink
⚡️ Make executable faster via GraalVM no fallback mode
Browse files Browse the repository at this point in the history
Using a lighter HTTP client library makes it possible
to use GraalVM native image with the no fallback mode.
Executable is now faster:

  time ./hubstats.core
  ...
  ./hubstats.core  0.00s user 0.00s system 60% cpu 0.008 total

instead of:

  time ./hubstats.core
  ...
  ./hubstats.core  5.34s user 0.28s system 234% cpu 2.398 total

See oracle/graal#1074 (comment)
  • Loading branch information
nicokosi committed Jul 15, 2019
1 parent 60a50b1 commit 6d9e821
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion generate-executable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ echo "Build executable from JAR via GraalVM:"
gu install native-image && \
native-image \
--allow-incomplete-classpath \
--force-fallback \
--no-fallback \
--initialize-at-build-time \
--no-server \
--report-unsupported-elements-at-runtime \
Expand Down
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.10.0"],
[org.clojure/data.json "0.2.6"],
[clj-http "3.9.1"],
[clj-http-lite "0.3.0"],
[slingshot "0.12.2"],
[clj-time "0.15.1"],
[org.clojure/core.async "0.4.490"]]
Expand Down
12 changes: 6 additions & 6 deletions src/hubstats/github.clj
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
(ns hubstats.github
(:require
[clojure.data.json :as json]
[clj-time.core :as time]
[clj-time.format :as time-format]
[clj-http.client :as http-client]
[slingshot.slingshot :refer [try+]]))
(:require
[clojure.data.json :as json]
[clj-time.core :as time]
[clj-time.format :as time-format]
[clj-http.lite.client :as http-client]
[slingshot.slingshot :refer [try+]]))

(def date-format (time-format/formatter "yyyy-MM-dd'T'HH:mm:ssZ"))

Expand Down

0 comments on commit 6d9e821

Please sign in to comment.