From 76ac0ea149e80369970bfd000200b74198046a3e Mon Sep 17 00:00:00 2001 From: Nicolas Kosinski Date: Mon, 15 Jul 2019 00:18:46 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Make=20executable=20faster?= =?UTF-8?q?=20via=20GraalVM=20no=20fallback=20mode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 https://github.com/oracle/graal/issues/1074#issuecomment-494053810 --- generate-executable.sh | 2 +- project.clj | 2 +- src/hubstats/github.clj | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/generate-executable.sh b/generate-executable.sh index 767a893..09a5295 100755 --- a/generate-executable.sh +++ b/generate-executable.sh @@ -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 \ diff --git a/project.clj b/project.clj index 9eff0c4..f989079 100644 --- a/project.clj +++ b/project.clj @@ -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"]] diff --git a/src/hubstats/github.clj b/src/hubstats/github.clj index 0cb2a38..eca5560 100644 --- a/src/hubstats/github.clj +++ b/src/hubstats/github.clj @@ -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"))