Skip to content

Commit 30ab632

Browse files
authored
Add mrhttp (#8819)
* Add mrhttp * Trigger action --------- Co-authored-by: Mark Reed <[email protected]>
1 parent e603c6c commit 30ab632

File tree

6 files changed

+95
-0
lines changed

6 files changed

+95
-0
lines changed

frameworks/Python/mrhttp/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# MrHTTP Benchmark Test
2+
3+
This is the MrHTTP portion of a [benchmarking tests suite](../../)
4+
comparing a variety of web development platforms.
5+
6+
The information below is specific to MrHTTP. For further guidance,
7+
review the [documentation](https://github.com/TechEmpower/FrameworkBenchmarks/wiki).
8+
Also note that there is additional information provided in
9+
the [Python README](../).
10+
11+
## Description
12+
13+
[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.
14+
15+
## Test Paths & Sources
16+
17+
All of the test implementations are located within a single file ([app.py](app.py)).
18+
19+
* [JSON Serialization](app.py): "/json"
20+
* [Plaintext](app.py): "/plaintext"

frameworks/Python/mrhttp/app.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
import multiprocessing
3+
import mrhttp
4+
import mrjson as json
5+
6+
app = mrhttp.Application()
7+
8+
@app.route('/json', _type="json")
9+
def j(r):
10+
return json.dumps({'message': 'Hello, world!'})
11+
12+
@app.route('/plaintext', _type="text", options=['cache'])
13+
def p(r):
14+
return "Hello, world!"
15+
16+
17+
app.run('0.0.0.0', 8080, cores=multiprocessing.cpu_count())
18+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"framework": "mrhttp",
3+
"tests": [{
4+
"default": {
5+
"json_url": "/json",
6+
"plaintext_url": "/plaintext",
7+
"port": 8080,
8+
"approach": "Realistic",
9+
"classification": "Micro",
10+
"framework": "mrhttp",
11+
"language": "Python",
12+
"flavor": "Python3",
13+
"platform": "None",
14+
"webserver": "None",
15+
"os": "Linux",
16+
"orm": "Raw",
17+
"database_os": "Linux",
18+
"database": "None",
19+
"display_name": "MrHTTP",
20+
"notes": ""
21+
}
22+
}]
23+
}

frameworks/Python/mrhttp/config.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[framework]
2+
name = "mrhttp"
3+
4+
[main]
5+
urls.plaintext = "/plaintext"
6+
urls.json = "/json"
7+
approach = "Realistic"
8+
classification = "Micro"
9+
database = "None"
10+
database_os = "Linux"
11+
os = "Linux"
12+
orm = "Raw"
13+
platform = "None"
14+
webserver = "None"
15+
versus = "None"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
FROM python:3.8.12
3+
4+
ADD ./ /mrhttp
5+
6+
WORKDIR /mrhttp
7+
8+
RUN pip3 install -r /mrhttp/requirements.txt
9+
10+
EXPOSE 8080
11+
12+
CMD python3 app.py
13+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
asyncpg==0.25.0
2+
mrjson==1.4
3+
ujson==5.4.0
4+
mrpacker==1.5
5+
mrhttp==0.12
6+
uvloop==0.19.0

0 commit comments

Comments
 (0)