8 ms·
Show HN: Robyn – A fast, extensible async Python web server with a Rust runtime
- benreesman 4y agoGood bindings between Python and Rust are a win all around.
- JshWright 4y agoPyO3 is great. It makes it super straightforward to write Python extensions in Rust.
- heavyset_go 4y agoIt's much more pleasant than writing C extensions, that's for sure. The Rust/Python toolchain and ecosystem are really impressive. They're not something I would have expected to have developed with as much quality as they have.
- extasia 4y agoCan anybody point me to a reputable benchmark comparing this vs e.g Starlette etc?
- sshine 4y agoOr Flask! My guess is that "fastest" refers to the request-response loop. I'd be interested in knowing how fast it is once you tack your favourite template rendering engine on top. It would be nice if there were drop-in support for Tera, the Rust template engine that is inspired by Jinja2: https://github.com/Keats/tera https://github.com/Keats/tera
- VWWHFSfQ 4y agoRonacher has ported jinja2 (partially) to Rust https://github.com/mitsuhiko/minijinja https://github.com/mitsuhiko/minijinja
- ramraj07 4y agoWho’s still using a python web framework with Template rendering in real scale ?
- nine_k 4y agoI rarely saw templating to be a bottleneck. Database access, way more often.
- prollyjethi 4y agoHey, The project is still in early stage and hence I don't show many comparisons. Here is a benchmark on TechEmpower - https://www.techempower.com/benchmarks/#section=test&runid=43469a25-670e-4bda-a3c3-652839435784&test=plaintext&l=hra0hr-35n&w=18y6o-0-0-0 https://www.techempower.com/benchmarks/#section=test&runid=4... I also have a comparison on the docs website: https://sansyrox.github.io/robyn/#/comparison https://sansyrox.github.io/robyn/#/comparison And my own benchmark code is https://github.com/sansyrox/robyn-comparison-benchmarks https://github.com/sansyrox/robyn-comparison-benchmarks
- metadat 4y agoI wish I could find the HN comment recently posted which eloquently explained why obsessing over webserver (and by extension, web framework) performance requests-per-second is foolish. The closest thing I could find is this: https://news.ycombinator.com/item?id=34002459 https://news.ycombinator.com/item?id=34002459 The tl;dr is: server requests-per-second is meaningless without realistic loads involving databases and other dependencies. Typically the external factors dominate request processing time. There might be compelling reasons to spring for Robyn over Flask [0] or FastAPI [1] but RPS shouldn't be one of them. [0] https://flask.palletsprojects.com/en/ https://flask.palletsprojects.com/en/ [1] https://fastapi.tiangolo.com/ https://fastapi.tiangolo.com/
- dividuum 4y agoThis one? https://news.ycombinator.com/item?id=34364975 https://news.ycombinator.com/item?id=34364975
- metadat 4y agoNot sure if this was it, but you rock for trying to piece it together. This is a good perspective in my humble opinion.
- totalhack 4y agoIf I recall correctly one of the things that slows FastAPI RPS down is pydantic, though there is active development to make a rust-based core for that too which is supposed to be ~10x faster.
- metadat 4y agoPelydantic is it's whole own separate comprised of adequate kindling for a religious war.
- deleted 4y ago[deleted]
- klabb3 4y agoI can’t find what language it’s written in, can someone help out?
- zach_garwood 4y agoWho cares? Someone will rewrite it in Rust soon.
- deleted 4y ago[deleted]
- meindnoch 4y agoIt says in the description: >Written in Rust, btw xD
- shaunrussell 4y agoHow do you know something is written in rust? They'll tell you.
- Aeolun 4y agoI’m always kind of sad that the only way to achieve this always seems to be native code. I think the value of having all your logic in the same language is undervalued (Ruby and Node also seem to often use bindings to something compiled).
- nicoburns 4y ago> I’m always kind of sad that the only way to achieve this always seems to be native code. I think the value of having all your logic in the same language is undervalued Well there's one way to have both: just write all your logic in a language that compiles to native.
- nextaccountic 4y agoBut, how often you actually mess up with the internals of your web framework? edit: here I'm biased because even if I used this project and would send a PR to it, I'm okay with doing it on either Python or Rust. But yeah, not every Python programmer can also code in Rust
- olivermuty 4y agoI’d be surprised if even 5% of python devs has put self written rust in production.
- cozzyd 4y agoPython probably has one of the higher percentages of monolingual developers (perhaps only JavaScript is higher?)
- codetrotter 4y agoBut the interpreter itself is written in a compiled language anyway. I don’t see why it matters much that frameworks and libraries you use are compiled code also. But like another sibling said, if you want all in one language, write it all in the compiled language. I use the Hyper library written in Rust, and write my code in Rust. One language, and a very nice one at that :)
- pipeline_peak 4y agoThe fastest _ written in Rust != The fastest _
- deleted 4y ago[deleted]
- nidnogg 4y agoWhat is with Rust and "Blazing™ Fast"? I know it should be a meme at this point but it's really getting stale and people don't seem to be using it as such.
- thethirdone 4y agoIt is a big red flag to me if a project claims "fast", but does not prominently show benchmarks. Previously I have seen projects that claim to be the fastest which are 10x slower than alternative popular projects. There are two major benefits I can see from making public benchmarks: 1. showing which other projects you are competing with and 2. having a benchmark suite you keep an eye on helps you actually make your project fast.
- jacob019 4y agoI would also like to see some benchmarks, especially compared to aiohttp since that is what it appears to replace. I too am skeptical, aiohttp isn't all that fast, but it's execution time is negligible in a typical application. I found aiohttp to be about half the speed of gevent.pywsgi, but it turns out that doesn't matter at all when the vast majority of time is spent executing business logic and serializing responses.
- mtrpcic 4y agoThis is funny, because often times as soon as you add benchmarks, the masses will scream that the benchmarks aren't useful because they don't test real world conditions (global network latency, wide ranges of queries with effectively random patterns, etc.). Benchmarks feel a bit like a "damned if you do, damned if you don't" situation. That said, I love me a good benchmark.
- thethirdone 4y agoThere is even a comment on this page saying requests per second isn't everything. So even if you don't benchmark they will still say that benchmarks aren't useful. Of course I agree that benchmarks can't tell the whole story, but they can demonstrate huge differences in potential performance which can give you a reason to create a realistic benchmark for your use case.
- jammycrisp 4y agoFor my own "fast" projects[1] I've taken to providing benchmarks, but adding a big 'ol caveat at the top describing ways in which the benchmark may not reflect reality. Some people really want to see benchmarks! Others are turned off by projects that overreach on performance claims. I'm hopeful that adding context around benchmarks to tamper excitement strikes the right balance. [1]: https://jcristharif.com/msgspec/benchmarks.html https://jcristharif.com/msgspec/benchmarks.html
- tpmx 4y agoIn my imagination this was the inspiration for the name. Robyn - With Every Heartbeat (Live Nobel Peace Prize 2008) https://www.youtube.com/watch?v=0oIuXDX8EcA&t=4s https://www.youtube.com/watch?v=0oIuXDX8EcA&t=4s
- mlinksva 4y agohttps://www.sanskar.me/posts/robyns_plans_for_2023 https://www.sanskar.me/posts/robyns_plans_for_2023 was posted last week.
- meitham 4y agoThe project logo is gorgeous!