Skip to content

Releases: sparckles/Robyn

v0.17.1 - Fix request header propagation and welcome new contributors

20 Jul 15:03

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.17.0...v0.17.1

v0.17.0 - Const Requests

06 Jul 23:54

Choose a tag to compare

This feature improves the performance substantially when you want to serve constant responses like simple strings, simple JSON payloads, etc.

Benchmark Source: https://github.com/sansyrox/robyn-comparrison-benchmarks

What's Changed

New Syntax

@app.get("/", const=True) # see the 'const' flag here
async def h(_):
    return "Hello, world!"

Performance upgrade

Robyn (6 workers)

➜  ~ oha --no-tui --insecure -c 100 -n 1000000 http://127.0.0.1:5000
Summary:
  Success rate:	1.0000
  Total:	1.9902 secs
  Slowest:	0.0477 secs
  Fastest:	0.0000 secs
  Average:	0.0002 secs
  Requests/sec:	502470.8499

  Total data:	12.40 MiB
  Size/request:	13 B
  Size/sec:	6.23 MiB

Response time histogram:
  0.000 [2608]   |
  0.000 [85802]  |■■■■■■
  0.000 [320394] |■■■■■■■■■■■■■■■■■■■■■■
  0.000 [456025] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  0.000 [88243]  |■■■■■■
  0.000 [13397]  |
  0.000 [6279]   |
  0.000 [4146]   |
  0.000 [2887]   |
  0.001 [2356]   |
  0.001 [17863]  |■

Latency distribution:
  10% in 0.0001 secs
  25% in 0.0002 secs
  50% in 0.0002 secs
  75% in 0.0002 secs
  90% in 0.0002 secs
  95% in 0.0003 secs
  99% in 0.0008 secs

Details (average, fastest, slowest):
  DNS+dialup:	0.0052 secs, 0.0001 secs, 0.0196 secs
  DNS-lookup:	0.0000 secs, 0.0000 secs, 0.0000 secs

Status code distribution:
  [200] 1000000 responses

FastAPI

➜  ~ oha --no-tui --insecure -c 100 -n 1000000 http://127.0.0.1:5001
Summary:
  Success rate:	1.0000
  Total:	12.2921 secs
  Slowest:	0.0471 secs
  Fastest:	0.0001 secs
  Average:	0.0012 secs
  Requests/sec:	81353.0018

  Total data:	12.40 MiB
  Size/request:	13 B
  Size/sec:	1.01 MiB

Response time histogram:
  0.000 [127872] |■■■■■■■■■■■■■■■■■■■■
  0.001 [178274] |■■■■■■■■■■■■■■■■■■■■■■■■■■■
  0.001 [199031] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  0.001 [204123] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  0.002 [126955] |■■■■■■■■■■■■■■■■■■■
  0.002 [80915]  |■■■■■■■■■■■■
  0.002 [33556]  |■■■■■
  0.003 [11592]  |■
  0.003 [5180]   |
  0.003 [3270]   |
  0.004 [29232]  |■■■■

Latency distribution:
  10% in 0.0004 secs
  25% in 0.0007 secs
  50% in 0.0011 secs
  75% in 0.0015 secs
  90% in 0.0020 secs
  95% in 0.0024 secs
  99% in 0.0058 secs

Details (average, fastest, slowest):
  DNS+dialup:	0.0113 secs, 0.0001 secs, 0.0451 secs
  DNS-lookup:	0.0000 secs, 0.0000 secs, 0.0001 secs

Status code distribution:
  [200] 1000000 responses

Starlette (24 workers)

➜  ~ oha --no-tui --insecure -c 100 -n 1000000 http://127.0.0.1:5003
Summary:
  Success rate:	1.0000
  Total:	9.8807 secs
  Slowest:	0.0534 secs
  Fastest:	0.0001 secs
  Average:	0.0010 secs
  Requests/sec:	101207.5486

  Total data:	12.40 MiB
  Size/request:	13 B
  Size/sec:	1.25 MiB

Response time histogram:
  0.000 [128086] |■■■■■■■■■■■■■■■■■■■
  0.001 [206731] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  0.001 [211417] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  0.001 [174363] |■■■■■■■■■■■■■■■■■■■■■■■■■■
  0.001 [120210] |■■■■■■■■■■■■■■■■■■
  0.002 [69490]  |■■■■■■■■■■
  0.002 [32373]  |■■■■
  0.002 [13678]  |■■
  0.002 [6528]   |
  0.003 [4052]   |
  0.003 [33072]  |■■■■■

Latency distribution:
  10% in 0.0003 secs
  25% in 0.0005 secs
  50% in 0.0008 secs
  75% in 0.0012 secs
  90% in 0.0016 secs
  95% in 0.0020 secs
  99% in 0.0053 secs

Details (average, fastest, slowest):
  DNS+dialup:	0.0368 secs, 0.0077 secs, 0.0520 secs
  DNS-lookup:	0.0000 secs, 0.0000 secs, 0.0001 secs

Status code distribution:
  [200] 1000000 responses

Flask (Bjoern)

➜  ~ oha --no-tui --insecure -c 100 -n 1000000 http://127.0.0.1:5000
Summary:
  Success rate:	1.0000
  Total:	113.6806 secs
  Slowest:	0.1515 secs
  Fastest:	0.0021 secs
  Average:	0.0114 secs
  Requests/sec:	8796.5722

  Total data:	12.40 MiB
  Size/request:	13 B
  Size/sec:	111.67 KiB

Response time histogram:
  0.005 [68]     |
  0.008 [246]    |
  0.011 [417517] |■■■■■■■■■■■■■■■■■■■■■■■
  0.014 [558015] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  0.017 [16685]  |
  0.020 [2962]   |
  0.022 [2796]   |
  0.025 [1357]   |
  0.028 [86]     |
  0.031 [187]    |
  0.034 [81]     |

Latency distribution:
  10% in 0.0099 secs
  25% in 0.0102 secs
  50% in 0.0112 secs
  75% in 0.0123 secs
  90% in 0.0129 secs
  95% in 0.0133 secs
  99% in 0.0157 secs

Details (average, fastest, slowest):
  DNS+dialup:	0.0352 secs, 0.0001 secs, 0.0509 secs
  DNS-lookup:	0.0000 secs, 0.0000 secs, 0.0000 secs

Status code distribution:
  [200] 1000000 responses

System Config

    eeeee  eeeeeeeeeeee   eeeee       OS: elementary OS 6.1 Jólnir x86_64
  eeee   eeeee       eee     eeee     Kernel: 5.13.0-51-generic
 eeee   eeee          eee     eeee    Uptime: 12 hours, 28 mins
eee    eee            eee       eee   Packages: 2369 (dpkg), 11 (flatpak), 12 (snap)
eee   eee            eee        eee   Shell: zsh 5.8
ee    eee           eeee       eeee   Resolution: 3840x2160, 2160x3840
ee    eee         eeeee      eeeeee   DE: Pantheon
ee    eee       eeeee      eeeee ee   WM: Mutter(Gala)
eee   eeee   eeeeee      eeeee  eee   Theme: io.elementary.stylesheet.blueberry [GTK3]
eee    eeeeeeeeee     eeeeee    eee   Icons: elementary [GTK3]
 eeeeeeeeeeeeeeeeeeeeeeee    eeeee    Terminal: alacritty
  eeeeeeee eeeeeeeeeeee      eeee     Terminal Font: DankMono Nerd Font
    eeeee                 eeeee       CPU: AMD Ryzen 9 5900X (24) @ 4.000GHz
      eeeeeee         eeeeeee         GPU: NVIDIA 09:00.0 NVIDIA Corporation Device 2489
         eeeeeeeeeeeeeeeee            Memory: 6090MiB / 64214MiB



Full Changelog: v0.16.6...v0.17.0

v0.16.6 - Fix the `--dev` flag crashing the app

02 Jul 22:10

Choose a tag to compare

What's Changed

Full Changelog: v0.16.4...v0.16.6

v0.16.4 - Reduced excess logging and added a `log_level` param. Performance improved substantially!

31 May 15:35

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.16.3...v0.16.4

No more dangling process and updated type stubs

18 May 19:11

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.16.2...v0.16.3

Now you can easily turn off Robyn by pressing Ctrl+C without having dangling processes.

Robyn Supports Types Now! ✨

09 May 20:42

Choose a tag to compare

If types is what the community shall ask for. Then types is what the community shall get! ✨

What's Changed

Special Thanks

Full Changelog: v0.16.0...v0.16.2

v0.16.0 Add Response Headers and Improve performance

29 Apr 12:10

Choose a tag to compare

What's Changed

New Contributors

  • @sombralibre made their first contribution in #189

Full Changelog: v0.15.1...v0.16.0

You can now have the response headers:

@app.get("/redirect")
async def redirect(request):
    return {"status_code": "307", "body": "", "type": "text", "headers": jsonify({"Location": "redirect_route"})}

Websocket ids now accessible in websocket functions

24 Mar 23:59

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.15.0...v0.15.1

Now, you can access web socket uuids from the functional calls

@websocket.on("message")
async def connect(websocket_id):
    print(websocket_id)
    global i
    i += 1
    if i == 0:
        return "Whaaat??"
    elif i == 1:
        return "Whooo??"
    elif i == 2:
        i = -1
        return "*chika* *chika* Slim Shady."

Mutable request objects

17 Mar 00:28

Choose a tag to compare

Now you can mutate the request object through the request callback.

Example below

@app.get("/redirect")
async def redirect(request):
    return {"status_code": "307", "body": "", "type": "text"}


@app.get("/redirect_route")
async def redirect_route(request):
    return "This is the redirected route"


@app.before_request("/redirect")
async def redirect_before_request(request):
    request["headers"]["Location"] = "redirect_route"
    return ""


@app.after_request("/redirect")
async def redirect_after_request(request):
    request["headers"]["Location"] = "redirect_route"
    return ""

v0.14.0 - Added custom response objects

03 Mar 00:42

Choose a tag to compare

Robyn supports custom response objects now! 🥳

What's Changed

Full Changelog: v0.13.1...v0.14.0

Example

@app.get("/")
async def hello(request):
    global callCount
    callCount += 1
    message = "Called " + str(callCount) + " times"
    print(message, request)
    return {"status_code": "200", "body": "hello", "type": "text"}


@app.get('/404')
def return_404():
    return {"status_code": "404", "body": "hello", "type": "text"}