Skip to content

Commit

Permalink
Documentation Update
Browse files Browse the repository at this point in the history
  • Loading branch information
sansyrox committed Dec 7, 2021
1 parent 04f6f29 commit 85483b5
Show file tree
Hide file tree
Showing 8 changed files with 108 additions and 11 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
[![Gitter](https://badges.gitter.im/robyn_/community.svg)](https://gitter.im/robyn_/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Downloads](https://static.pepy.tech/personalized-badge/robyn?period=total&units=international_system&left_color=grey&right_color=blue&left_text=Downloads)](https://pepy.tech/project/robyn)


[Docs](https://sansyrox.github.io/robyn/#/)

Robyn is an async Python backend server with a runtime written in Rust, btw.

Python server running on top of of Rust Async RunTime.
Expand Down Expand Up @@ -34,6 +37,20 @@ app.start(port=5000)

```

## Features
- Under active development!
- Written in Russt, btw xD
- A multithreaded Runtime
- Extensible
- A simple API
- Sync and Async Function Support
- Dynamic URL Routing
- Multi Core Scaling
- WebSockets!
- Hot Reloading (Still experimental)
- Community First and truly FOSS!


## Contributor Guidelines

Feel free to open an issue for any clarification or for any suggestions.
Expand Down
13 changes: 7 additions & 6 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,19 @@ To read about the detailed architecture, you can read [here](https://sansyrox.gi

## Testing on Python

1. `cargo build --release`
2. `cp target/release/librobyn.dylib ./robyn.so`
3. `python3`
4. `import robyn`
5. `dir(robyn)`
1. Activate a virtual environment
2. Install maturin: `pip3 install maturin`
3. Create a Debug build: `maturin develop`
4. Test it out: `python3`
5. `import robyn`
6. `dir(robyn)`

## To Run

### Without hot reloading
`python3 app.py`

### With hot reloading
### With hot reloading(still beta)
`python3 app.py --dev=true`


Expand Down
1 change: 1 addition & 0 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!-- docs/_sidebar.md -->

- [Home](/)
- [Features](features.md)
- [API](api.md)
- [Architecture](architecture.md)
- [Comparison](comparison.md)
Expand Down
9 changes: 6 additions & 3 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,15 @@ def message():

```


## MutliCore Scaling

The three methods:
- "message" is called when the socket receives a message
- "close" is called when the socket is disconnected
- "connect" is called when the socket connects

To see a complete service in action, you can go to the folder [../integration_tests/base_routes.py](../integration_tests/base_routes.py)

## MutliCore Scaling

To run Robyn across multiple cores, you can use the following command:

`python3 app.py --workers=N --processes=N`
52 changes: 52 additions & 0 deletions docs/comparison.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ I used [oha](https://github.com/hatoo/oha) to perform the testing of 10000 reque
Requests/sec: 5457.2339
```

4. Robyn (5 workers)
```
Total: 1.5592 secs
Slowest: 0.0211 secs
Fastest: 0.0017 secs
Average: 0.0078 secs
Requests/sec: 6413.6480
```

Robyn is able to serve the 10k requests in 1.8 seconds followed by Flask and FastAPI, which take around 5 seconds(using 5 workers on a dual core machine). Finally, Django takes around 13.5070 seconds.

## Verbose Logs
Expand Down Expand Up @@ -222,3 +231,46 @@ Status code distribution:
```


Robyn(with 5 workers)
```
Summary:
Success rate: 1.0000
Total: 1.5592 secs
Slowest: 0.0211 secs
Fastest: 0.0017 secs
Average: 0.0078 secs
Requests/sec: 6413.6480
Total data: 126.95 KiB
Size/request: 13 B
Size/sec: 81.42 KiB
Response time histogram:
0.002 [30] |
0.004 [599] |■■■■■
0.005 [3336] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
0.007 [3309] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
0.009 [1614] |■■■■■■■■■■■■■■■
0.011 [749] |■■■■■■■
0.012 [253] |■■
0.014 [94] |
0.016 [14] |
0.018 [1] |
0.019 [1] |
Latency distribution:
10% in 0.0055 secs
25% in 0.0063 secs
50% in 0.0074 secs
75% in 0.0089 secs
90% in 0.0107 secs
95% in 0.0117 secs
99% in 0.0142 secs
Details (average, fastest, slowest):
DNS+dialup: 0.0022 secs, 0.0013 secs, 0.0028 secs
DNS-lookup: 0.0000 secs, 0.0000 secs, 0.0001 secs
Status code distribution:
[200] 10000 responses
```
13 changes: 13 additions & 0 deletions docs/features.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Features
- Under active development!
- Written in Rust, btw xD
- A multithreaded Runtime
- Extensible
- A simple API
- Sync and Async Function Support
- Dynamic URL Routing
- Multi Core Scaling
- WebSocket!
- Hot Reloading (Still experimental)
- Community First and truly FOSS!

5 changes: 3 additions & 2 deletions docs/roadmap.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Future Roadmap

- Integrate WebSockets
- Add session/cookie plugins
- Add the plugin documentation
- Create a WEB3 plugin
- Add graphql integration
- And more...

9 changes: 9 additions & 0 deletions integration_tests/index.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from robyn import Robyn

app = Robyn(__file__)

@app.get("/")
async def h():
return 'Hello, world!'

app.start()

0 comments on commit 85483b5

Please sign in to comment.