Skip to content

Commit

Permalink
update python example; sanic deps in flake.nix, measure_all.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
renerocksai committed Feb 25, 2025
1 parent 7867f32 commit 2529ae7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
wrk
python3
python3Packages.sanic
python3Packages.setuptools
python3Packages.matplotlib
poetry
poetry
Expand Down
6 changes: 5 additions & 1 deletion wrk/measure_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ fi

SUBJECTS="$1"

if [ "$SUBJECTS" = "README" ] ; then
if [ "$SUBJECTS" = "README" ] ; then
rm -f wrk/*.perflog
SUBJECTS="zig-zap go python-sanic rust-axum csharp cpp-beast"
# above targets csharp and cpp-beast are out of date!
SUBJECTS="zig-zap go python-sanic rust-axum"
fi

if [ -z "$SUBJECTS" ] ; then
SUBJECTS="zig-zap go python python-sanic rust-bythebook rust-bythebook-improved rust-clean rust-axum csharp cpp-beast"
# above targets csharp and cpp-beast are out of date!
SUBJECTS="zig-zap go python python-sanic rust-bythebook rust-bythebook-improved rust-clean rust-axum"
fi

for S in $SUBJECTS; do
Expand Down
11 changes: 7 additions & 4 deletions wrk/python/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@

class MyServer(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.send_header("Content-type", "text/html")
self.end_headers()
self.wfile.write(bytes("HI FROM PYTHON!!!", "utf-8"))
try:
self.send_response(200)
self.send_header("Content-type", "text/html")
self.end_headers()
self.wfile.write(bytes("HI FROM PYTHON!!!", "utf-8"))
except:
pass

def log_message(self, format, *args):
return
Expand Down

0 comments on commit 2529ae7

Please sign in to comment.