{"id":18450509,"url":"https://github.com/joshiemoore/ludicrous","last_synced_at":"2025-06-23T04:36:33.150Z","repository":{"id":57751591,"uuid":"527407554","full_name":"joshiemoore/ludicrous","owner":"joshiemoore","description":"ludicrous speed JSON API framework for Python","archived":false,"fork":false,"pushed_at":"2022-09-11T20:52:23.000Z","size":54,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-17T04:19:09.405Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pypi.org/project/ludicrous/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joshiemoore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-22T04:13:31.000Z","updated_at":"2023-08-26T11:29:48.000Z","dependencies_parsed_at":"2022-08-23T18:20:49.487Z","dependency_job_id":null,"html_url":"https://github.com/joshiemoore/ludicrous","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshiemoore%2Fludicrous","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshiemoore%2Fludicrous/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshiemoore%2Fludicrous/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshiemoore%2Fludicrous/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joshiemoore","download_url":"https://codeload.github.com/joshiemoore/ludicrous/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249190693,"owners_count":21227417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T07:25:25.394Z","updated_at":"2025-04-16T03:28:40.972Z","avatar_url":"https://github.com/joshiemoore.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ludicrous\nludicrous is the fastest JSON API framework for Python in terms of single-process performance. Light speed was too slow, so we had to go straight to LUDICROUS SPEED!\n\nludicrous is not a general-purpose web framework. Rather, it is meant for creating fast JSON APIs for pairing with a frontend framework like React.\n\nThis library is currently very early in development, and should be considered unstable and unready for production. For the time being, the library and documentation are subject to breaking change with little notice.\n\nludicrous is free software licensed under the terms of the GNU General Public License Version 2.\n\n## Quickstart\n\n1. Install ludicrous from PyPI: `$ pip install ludicrous`\n\n2. Copy the following code to `helloworld.py`:\n   ```\n   import ludicrous.route\n   import ludicrous.server\n\n   @ludicrous.route.route(\"/\")\n   def hello(request):\n       # objects returned from routes will be automatically\n       # serialized into JSON responses by ludicrous\n       return {\"hello\": \"world\"}\n\n   if __name__ == \"__main__\":\n       # host and port kwargs are optional\n       ludicrous.server.run(host=\"localhost\", port=8000)\n   ```\n\n3. Launch the server: `$ python3 helloworld.py`\n\n4. Use your web browser to navigate to `http://localhost:8000/` and observe the JSON response.\n\nSee [docs/EXAMPLES.md](docs/EXAMPLES.md) for some examples to help get you started.\n\n## Build from source\n1. Clone the repository: `$ git clone --recursive https://github.com/joshiemoore/ludicrous.git`\n\n2. Enter the directory: `$ cd ludicrous`\n\n3. Build the library: `$ python3 -m build`\n\n4. Install the library: `$ pip install .`\n\nNote that ludicrous is intended for development and deployment on GNU/Linux and is not tested on any other operating systems.\n\n## Performance\nludicrous is being developed around a custom JSON serializer which converts Python objects directly into JSON C strings.\n\nPreliminary testing on my machine (12th Gen Intel Core i5-1240P) using [wrk](https://github.com/wg/wrk) shows that ludicrous is able to consistently sustain hundreds of thousands of requests per second.\n\nBelow is a selection of wrk results for endpoints returning `{\"hello\": \"world\"}` in a few frameworks. Each framework was tested 5 times, and the best of the 5 results is displayed here. The main point of interest is the `Requests/sec` field.\n\n```\nludicrous:\nRunning 30s test @ http://localhost:8000/\n  12 threads and 400 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency     4.67ms   60.28ms   1.68s    99.41%\n    Req/Sec    20.16k    14.15k  157.92k    64.57%\n  7235771 requests in 30.10s, 662.45MB read\n  Socket errors: connect 0, read 0, write 0, timeout 44\nRequests/sec: 240390.46\nTransfer/sec:     22.01MB\n\njapronto:\nRunning 30s test @ http://localhost:8080/\n  12 threads and 400 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency     2.06ms  160.54us   6.50ms   93.71%\n    Req/Sec    16.01k     1.42k   52.70k    95.76%\n  5743105 requests in 30.08s, 569.61MB read\nRequests/sec: 190899.12\nTransfer/sec:     18.93MB\n\nnodejs:\nRunning 30s test @ http://localhost:8000/\n  12 threads and 400 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency     4.02ms    2.16ms 100.90ms   99.46%\n    Req/Sec     8.41k   596.33    23.19k    98.92%\n  3018151 requests in 30.09s, 549.76MB read\nRequests/sec: 100314.22\nTransfer/sec:     18.27MB\n\nfastapi\nRunning 30s test @ http://localhost:8000/\n  12 threads and 400 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency    60.11ms    5.02ms 140.70ms   82.74%\n    Req/Sec   551.43    154.96     1.32k    67.45%\n  197824 requests in 30.10s, 26.79MB read\nRequests/sec:   6572.38\nTransfer/sec:      0.89MB\n\nbottle:\nRunning 30s test @ http://localhost:8000/\n  12 threads and 400 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency     2.91ms   43.11ms   1.69s    99.57%\n    Req/Sec     1.38k     0.94k    4.91k    63.57%\n  99917 requests in 30.08s, 15.72MB read\n  Socket errors: connect 0, read 0, write 0, timeout 39\nRequests/sec:   3322.10\nTransfer/sec:    535.31KB\n\nflask:\nRunning 30s test @ http://localhost:5000/\n  12 threads and 400 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency    77.99ms   77.18ms   1.77s    98.56%\n    Req/Sec   156.98    104.71   640.00     58.42%\n  54683 requests in 30.10s, 9.54MB read\n  Socket errors: connect 0, read 31, write 0, timeout 41\nRequests/sec:   1816.87\nTransfer/sec:    324.70KB\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshiemoore%2Fludicrous","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoshiemoore%2Fludicrous","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshiemoore%2Fludicrous/lists"}