9 ms·
Falcon is a high-performance Python Web framework
- julenx 12y agoThe website is saying how good the framework is but I really miss seeing right on the homepage how code written using this framework looks like. Flask's website is really good at this, for instance.
- Nagyman 12y agoAgreed; their README is better which includes sample code: https://github.com/racker/falcon/blob/master/README.md https://github.com/racker/falcon/blob/master/README.md
- netnichols 12y agoMy first thoughts as well when scanning the homepage.
- sebasmagri 12y agoIt should be fixed now.
- thezilch 12y agoWhat about when I have auth or any number of middleware and am hitting a cached-object store; do the performance gains continue to stand out? With just a few dict and string operations, their tests showed performance dropped considerably. I'm going to be doing more than that in each request; I'm not going to use this to use Python to serve anything but dynamic content. Would be nice to see them on https://www.techempower.com/benchmarks/#section=data-r9&hw=peak&test=db&l=1kw https://www.techempower.com/benchmarks/#section=data-r9&hw=p...
- bliti 12y agoI welcome any effort that aims to improve performance and the python Web ecosystem. From the code in the tutorials Falcon feels a little un-pythonic. This is not a criticism. But a comparison from my experience with other python frameworks (mainly django and flask). It is unfair to compare mature frameworks with a new one. Though this one feels a bit java-ish. Good? Bad? To me that's good. It's stepping out of the comfort zone a bit. Rather than read purely like the idioms of the language, it seems to aim to read like the process it defines. Something that other frameworks abstract down their own idioms.
- amelius 12y agoHigh performance, makes me wonder how it deals with the GIL (global interpreter lock).
- mrits 12y agoThat's not really a problem with serving web requests. Usually there isn't a downside to multiprocessing these. I don't know anything about this framework but I assume it is using some sort of non-blocking IO which works just about as well as OS threads for web servers. Look at something like Gevent if you are interested in this.
- amelius 12y agoThe problem is that sometimes you do need to do some heavy processing while servicing a request, and then you're blocking all other users. Event-driven processing is much like cooperative multitasking from the Windows 3.1 days. It only works well if every part of the machinery behaves properly and predictively.
- ivoras 12y agoWow, is Python3 still that much slower than Python2?
- agentultra 12y agoiirc, Python 3.4 saw a strong leap in performance largely related to unicode. Could be wrong but the earlier versions of Python 3 did suffer some slow down.
- cbsmith 12y agoIt also helps that Python2 based web frameworks play a bit fast & loose with the odd ambiguities in the HTTP protocol that Python3 won't let you get away with.
- mangeletti 12y agoPerformance is always a factor for me, until IBM finishes that new line of $1.00 servers that don't use electricity and are the size of an atom... in the meantime, we can continue to learn from highly performant libraries and frameworks like this.
- agounaris 12y agoI'm just wondering if the name is already taken :P slightly different but still same sound http://www.phalconphp.com/en/ http://www.phalconphp.com/en/
- spooneybarger 12y ago120 req/s is considered fast?
- rdtsc 12y agoFrom the linked page under Benefits/Performance section: --- Many frameworks max out at serving simple "hello world" requests at a few thousand req/sec, while Falcon can easily serve many more on the same hardware. --- Looking at a sibling post it seems like you are just not aware that in many countries , is the decimal separator.
- detaro 12y agoYou probably mean "is not the decimal separator", because he interpreted it as such.
- deleted 12y ago[deleted]
- houli 12y ago120,000 req/s Just a really unfortunate comma that looks like a decimal point.
- coldtea 12y agoIn some countries, including in Europe, "," IS the decimal "point", and "." is the thousands separator.
- deleted 12y ago[deleted]
- cbsmith 12y agoLet me guess... LCD font smoothing on a reasonably high resolution Apple display?
- japhyr 12y agoCan someone compare this to Django/ Flask? Would building a project with Falcon be similar to building a project with Flask? This looks interesting, but I'm not well versed at evaluating a new web framework. I've built a few projects in Django, and I have a basic understanding of how I'd go about building a project in Flask. I've never worked on a high-traffic project.
- jaytaylor 12y agoTheir GitHub README includes some examples [0]. It is sort of a hybrid between Django+TastyPie (Object-Oriented API wiring) combined with Flask or Bottle. [0] https://github.com/racker/falcon#usage https://github.com/racker/falcon#usage
- simonpantzare 12y agoIt's not like Django + TastyPie just because it uses OO. If you are building a service with two or three endpoints, that combo is overkill. “You wanted a banana but what you got was a gorilla holding the banana and the entire jungle.” comes to mind. It's closer to Flask feature-wise.
- simonpantzare 12y agoDjango is much larger with its ORM, template system, admin site, and so on. Feature-wise it seems close to Flask. I suspect that Flask is more opinionated than Falcon: it requires the Jinja2 template library and your project may end up with a tight coupling with Flask if you use its blueprint system or don't think through how you use Flask's context variables flask.request and flask.g (Flask tries to be too clever here IMO). Falcon looks more like a library than a framework to me and its design seems less likely to affect how you structure projects compared to Django in particular but also Flask.
- ascotan 12y agoFlask likely requires Jinja2 because they're both made by the same team. http://www.pocoo.org/team/#armin-ronacher http://www.pocoo.org/team/#armin-ronacher
- fastball 12y agoI normally use bottle and this isn't much of a step of from that, it would seem. The more important takeaway seems to be that if you use flask, you should probably be using bottlepy instead, as my experience with both indicates that they are otherwise functionally the same.
- RussianCow 12y agoFlask has a much larger pool of community extensions, and in general has more community support and more "batteries included" than Bottle. In my opinion, there is no real reason to use Bottle anymore.
- bpicolo 12y agoCommunity extensions are exactly what I dislike about Flask. I want extensibility without custom extensions. I want the framework to be out of the way entirely when I choose additional packages to work with.
- detaro 12y agothen don't use the extensions? Not trying to be snarky, I might be missing something, but does Flask actually make it harder to use additional packages?
- corford 12y agoNope. You can use whatever packages you like. Those you've rolled yourself, standard python packages like psycopg2, redis-py etc., Flask community provided packages and anything in between. I'm building a fairly large webapp in Flask and rarely, if at all, use any Flask packages other than the core itself.
- rcarmo 12y agoHmmm. I get nice templating and very straightforward routing with Bottle. Why shouldn't I use that, especially since I can review the whole codebase in half an hour?
- jaytaylor 12y agoIf performance is that important for your use-case, why are you using python? Wouldn't it be better to use an appropriate tool more suitable for your needs? Is the performance difference between Django+TastyPie, Flask, or Falcon really going to be the bottleneck holding you back from achieving greatness? If so..then maybe it's better to consider a different tool set. Any number of other high-performance solutions fit the bill: Go, Java JAXRS, etc.. After having spent over a decade in Python-land myself, I've learned that a Framework's ease-of-use by developers is vastly more important than any micro-benchmark performance. When I evaluated Falcon for it's usability in mid-2014 I found it painful when compared to Flask or Bottle. -- But if benchmarks are your thing, for laughs, I've found some which compare Go / Python / Java etc (hey, at least they are data-driven :) : https://www.techempower.com/benchmarks/ https://www.techempower.com/benchmarks/ - here "Falcon" scores below Go, Java, and PHP frameworks. http://ziutek.github.io/web_bench/ http://ziutek.github.io/web_bench/ https://medium.com/@tschundeee/express-vs-flask-vs-go-acc0879c2122 https://medium.com/@tschundeee/express-vs-flask-vs-go-acc087...
- encoderer 12y agoThere are many reasons I might want a framework that emphasizes speed but am unable or unwilling to abandon Python.
- jaytaylor 12y agoHow frequently has your selection of web-framework ultimately been the limiting factor leading to a real-life performance bottleneck? I've dealt with python scaling issues up to thousands of simultaneously active users and the performance bottlenecks have yet to boil down to the difference between which web-framework was used. I agree there are certainly use-cases for a speedy python web-framework. I am not sure I agree with refusing to abandon Python at all/high costs, and I question the value of Falcon for most of us. Since Falcon is well-suited to such a narrow band of use case(s), in most instances it contributes to the background noise of obscure web-frameworks.
- encoderer 12y ago
- egeozcan 12y agoOne would think that there's too much competition and enough maturity among Python web frameworks to see such speed gains.
- hmans 12y agoA framework, by definition, must be opinionated. A framework without opinions is just a library.
- Patrick_Devine 12y agoI recently used Falcon to hack together a quick email backend for an ajax comments form, and found it really useful. It's super lightweight and was relatively easy to get working with uwsgi/nginx. I've used Django and Pecan in the past, and both are much more full featured (Django by a couple orders of magnitude), so it's not really clear to me which I'd use for a large project. For something quick and dirty, Falcon seems like a reasonable bet.
- andrewstuart 12y agoThe value of Falcon for me is less its performance and more that it it for building REST APIs and does not carry the legacy of trying to support creation of Html front ends, along with all the associated complexity and cruft and dilution.
- richardolsson 12y agoI've recently started using Falcon, and also contributed some code to it (e.g. an even faster router which generates and compiles python code representing the URI tree). The main benefit for me, and the reason why I chose Falcon over other frameworks, is that Falcon is entirely designed around the task of creating REST APIs. You wouldn't use it to create a blog or news site or whatever. You would perhaps use it to create an API backend for any of those though. This makes it light-weight, and also opens the possibility for some design decisions that would not work in a more general purpose type of framework. In that regard, Falcon is definitely more opinionated than other frameworks (it's opinion being that you should build REST APIs), but in others, such as choice of response encoder, storage et c, it's not.
- pjmlp 12y agoPerformance and Python on the same sentence?!?