Browse Source

[New Framework] Nim/Prologue (#6084)

* Create App.nim

* Rename frameworks/Nim/Prologue/App.nim to frameworks/Nim/prologue/App.nim

* Create benchmark_config.json

* Create prologue.dockerfile

* Update benchmark_config.json

* Create prologue.nimble

* Create README.md

* Update .travis.yml

* Update benchmark_config.json

* Update prologue.dockerfile

* Rename App.nim to app.nim

* Update prologue.dockerfile

* Update prologue.dockerfile

* Update prologue.dockerfile

* Update prologue.nimble

* Update prologue.dockerfile

* Rename prologue.nimble to app.nimble

* Update prologue.dockerfile

* Update prologue.dockerfile

* Update prologue.dockerfile

* Update prologue.dockerfile

* Changed nim version to nimlang/nim:1.0.10

* updated nim version in the nimble file to 1.0.10

* removing explicit install step as it is redundant

* I have no idea what i am doing

I only want this madness to end

* updated nim to 1.4

* updated nimble to nim 1.4.0

* Fixed nim frameworks running twice

Removed `    - 'TESTDIR="Nim/httpbeast Nim/jester Nim/basolato Nim/prologue"'` so that only the lang command runs now.
Rishav Sharan 4 years ago
parent
commit
af0b54850f

+ 0 - 1
.travis.yml

@@ -63,7 +63,6 @@ env:
     - "TESTLANG=Lua"
     - "TESTLANG=Mumps"
     - "TESTLANG=Nim"
-    - 'TESTDIR="Nim/httpbeast Nim/jester Nim/basolato"'
     - "TESTLANG=OCaml"
     - "TESTLANG=Perl"
     - 'TESTDIR="PHP/php"'

+ 16 - 0
frameworks/Nim/prologue/README.md

@@ -0,0 +1,16 @@
+# Prologue Benchmarking Test
+For more details on this library, see https://planety.github.io/prologue/
+## Important Libraries
+
+The tests were run with:
+
+* [Prologue](https://github.com/planety/prologue)
+
+## Test URLs
+### JSON
+
+http://localhost:8080/json
+
+### PLAINTEXT
+
+http://localhost:8080/plaintext

+ 12 - 0
frameworks/Nim/prologue/app.nim

@@ -0,0 +1,12 @@
+import prologue, json
+
+proc handlePlaintext*(ctx: Context) {.async.} =
+    resp plainTextResponse "Hello, World!"
+
+proc handleJson*(ctx: Context) {.async.} =
+    resp jsonResponse %*{"message": "Hello, World!"}
+
+var app = newApp(settings = newSettings(debug = false))
+app.addRoute("/plaintext", handlePlaintext)
+app.addRoute("/json", handleJson)
+app.run()

+ 13 - 0
frameworks/Nim/prologue/app.nimble

@@ -0,0 +1,13 @@
+# Package
+
+version       = "0.1.0"
+author        = "Rishav Sharan"
+description   = "Techempower Nim-Prologue benchmark"
+license       = "MIT"
+bin           = @["app"]
+skipExt       = @["nim"]
+
+# Dependencies
+
+requires "nim >= 1.4.0"
+requires "prologue >= 0.4.0"

+ 24 - 0
frameworks/Nim/prologue/benchmark_config.json

@@ -0,0 +1,24 @@
+{
+  "framework": "prologue",
+  "tests": [{
+    "default": {
+      "json_url": "/json",
+      "plaintext_url": "/plaintext",
+      "port": 8080,
+      "approach": "Realistic",
+      "classification": "Fullstack",
+      "database": "None",
+      "framework": "prologue",
+      "language": "Nim",
+      "flavor": "None",
+      "orm": "Raw",
+      "platform": "None",
+      "webserver": "None",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "Prologue",
+      "notes": "",
+      "versus": "httpbeast"
+    }
+  }]
+}

+ 10 - 0
frameworks/Nim/prologue/prologue.dockerfile

@@ -0,0 +1,10 @@
+FROM nimlang/nim:1.4.0
+
+ADD ./ /prologue
+
+WORKDIR /prologue
+
+RUN nimble c --d:release --threads:on -y app.nim
+
+CMD ./app
+