Browse Source

Add mrhttp (#8819)

* Add mrhttp

* Trigger action

---------

Co-authored-by: Mark Reed <[email protected]>
Mark Reed 1 year ago
parent
commit
30ab632b75

+ 20 - 0
frameworks/Python/mrhttp/README.md

@@ -0,0 +1,20 @@
+# MrHTTP Benchmark Test
+
+This is the MrHTTP portion of a [benchmarking tests suite](../../)
+comparing a variety of web development platforms.
+
+The information below is specific to MrHTTP. For further guidance,
+review the [documentation](https://github.com/TechEmpower/FrameworkBenchmarks/wiki).
+Also note that there is additional information provided in
+the [Python README](../).
+
+## Description
+
+[MrHTTP](https://github.com/MarkReedZ/mrhttp) is an asynchronous web framework for python 3.5+ written in C that has hit 8.5 million requests per second.
+
+## Test Paths & Sources
+
+All of the test implementations are located within a single file ([app.py](app.py)).
+
+* [JSON Serialization](app.py): "/json"
+* [Plaintext](app.py): "/plaintext"

+ 18 - 0
frameworks/Python/mrhttp/app.py

@@ -0,0 +1,18 @@
+
+import multiprocessing
+import mrhttp
+import mrjson as json
+
+app = mrhttp.Application()
+
[email protected]('/json', _type="json")
+def j(r):
+  return json.dumps({'message': 'Hello, world!'})
+
[email protected]('/plaintext', _type="text", options=['cache'])
+def p(r):
+  return "Hello, world!"
+
+
+app.run('0.0.0.0', 8080, cores=multiprocessing.cpu_count())
+

+ 23 - 0
frameworks/Python/mrhttp/benchmark_config.json

@@ -0,0 +1,23 @@
+{
+  "framework": "mrhttp",
+  "tests": [{
+    "default": {
+      "json_url": "/json",
+      "plaintext_url": "/plaintext",
+      "port": 8080,
+      "approach": "Realistic",
+      "classification": "Micro",
+      "framework": "mrhttp",
+      "language": "Python",
+      "flavor": "Python3",
+      "platform": "None",
+      "webserver": "None",
+      "os": "Linux",
+      "orm": "Raw",
+      "database_os": "Linux",
+      "database": "None",
+      "display_name": "MrHTTP",
+      "notes": ""
+    }
+  }]
+}

+ 15 - 0
frameworks/Python/mrhttp/config.toml

@@ -0,0 +1,15 @@
+[framework]
+name = "mrhttp"
+
+[main]
+urls.plaintext = "/plaintext"
+urls.json = "/json"
+approach = "Realistic"
+classification = "Micro"
+database = "None"
+database_os = "Linux"
+os = "Linux"
+orm = "Raw"
+platform = "None"
+webserver = "None"
+versus = "None"

+ 13 - 0
frameworks/Python/mrhttp/mrhttp.dockerfile

@@ -0,0 +1,13 @@
+
+FROM python:3.8.12
+
+ADD ./ /mrhttp
+
+WORKDIR /mrhttp
+
+RUN pip3 install -r /mrhttp/requirements.txt
+
+EXPOSE 8080
+
+CMD python3 app.py
+

+ 6 - 0
frameworks/Python/mrhttp/requirements.txt

@@ -0,0 +1,6 @@
+asyncpg==0.25.0
+mrjson==1.4
+ujson==5.4.0
+mrpacker==1.5
+mrhttp==0.12
+uvloop==0.19.0