-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add mrhttp * Trigger action --------- Co-authored-by: Mark Reed <[email protected]>
- Loading branch information
Showing
6 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
import multiprocessing | ||
import mrhttp | ||
import mrjson as json | ||
|
||
app = mrhttp.Application() | ||
|
||
@app.route('/json', _type="json") | ||
def j(r): | ||
return json.dumps({'message': 'Hello, world!'}) | ||
|
||
@app.route('/plaintext', _type="text", options=['cache']) | ||
def p(r): | ||
return "Hello, world!" | ||
|
||
|
||
app.run('0.0.0.0', 8080, cores=multiprocessing.cpu_count()) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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": "" | ||
} | ||
}] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |