@@ -0,0 +1,25 @@
+# Immutant Benchmarking Test
+
+This is the [Immutant](http://immutant.org/) portion of a [benchmarking test suite](../) comparing a variety of web development platforms.
+### JSON Encoding Test
+* [JSON test source](hello/src/hello/handler.clj)
+## Infrastructure Software Versions
+The dependencies are documented in [project.clj](hello/project.clj),
+but the main ones are:
+* [Clojure 1.9.0](http://clojure.org/)
+* [ikitommi/immutant-web "3.0.0-alpha1"](https://github.com/ikitommi/immutant) - a performant fork of [Immutant]((http://immutant.org/))
+* [metosin/jsonista "0.1.1"](https://github.com/metosin/jsonista)
+## Test URLs
+http://localhost:8080/json
+### Plaintext Test
+http://localhost:8080/plaintext
@@ -0,0 +1,24 @@
+{
+ "framework": "immutant",
+ "tests": [{
+ "default": {
+ "json_url": "/json",
+ "plaintext_url": "/plaintext",
+ "port": 8080,
+ "approach": "Realistic",
+ "classification": "Micro",
+ "database": "None",
+ "language": "Clojure",
+ "flavor": "None",
+ "orm": "Raw",
+ "platform": "Undertow",
+ "webserver": "None",
+ "os": "Linux",
+ "database_os": "Linux",
+ "display_name": "immutant",
+ "notes": "",
+ "versus": "Undertow"
+ }
+ }]
+}
@@ -0,0 +1,6 @@
+FROM clojure:lein-2.8.1
+WORKDIR /immutant
+COPY src src
+COPY project.clj project.clj
+RUN lein uberjar
+CMD ["java", "-server", "-XX:+UseNUMA", "-XX:+UseParallelGC", "-XX:+AggressiveOpts", "-jar", "target/hello-immutant-standalone.jar"]
@@ -0,0 +1,8 @@
+(defproject hello "immutant"
+ :description "Immutant, Jsonista"
+ :dependencies [[org.clojure/clojure "1.9.0"]
+ [ikitommi/immutant-web "3.0.0-alpha1"]
+ [metosin/jsonista "0.1.1"]]
+ :jvm-opts ^:replace ["-Dclojure.compiler.direct-linking=true"]
+ :main hello.handler
+ :aot :all)
@@ -0,0 +1,26 @@
+(ns hello.handler
+ (:require [immutant.web :as web]
+ [jsonista.core :as json])
+ (:gen-class))
+(def plaintext-response
+ {:status 200
+ :headers {"content-type" "text/plain; charset=utf-8"}
+ :body (.getBytes "Hello, World!")})
+(defn app [req]
+ (let [uri (:uri req)]
+ (cond
+ (.equals "/plaintext" uri) plaintext-response
+ (.equals "/json" uri) {:status 200
+ :headers {"content-type" "application/json"}
+ :body (json/write-value-as-bytes {:message "Hello, World!"})}
+ :else {:status 404})))
+(defn -main [& _]
+ (web/run
+ app
+ {:port 8080
+ :host "0.0.0.0"
+ :dispatch? false
+ :server {:always-set-keep-alive false}}))
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+ <logger name="com.mchange">
+ <level value="WARN"/>
+ </logger>
+</log4j:configuration>