3 ms·
Well, I've posted my benchmarks. Where are yours ?
by zzzeek 12y ago
Well, I've posted my benchmarks. Where are yours ?
- RussianCow 12y agoI ran benchmarks for the app I mentioned. I don't have them on me because I no longer work for the company, but the database was the bottleneck on every request once we switched to PyPy. Again, I'm not saying your benchmarks are invalid, but the assumptions you make don't hold for all (or probably even the majority) of business web apps.
- gtaylor 12y agoAnecdotally, I've seen quite a few Django apps using gevent "just because". If you don't need it, you're just incurring additional overhead for no gain (which is what the author is saying). There are legitimate usage cases for async patterns, but I have seen them used even in situations where they made things slower.
- zzzeek 12y agoMy post is aimed first and foremost at the Openstack community. Openstack is a large series of CRUD-based applications that don't run any stored procedures or business logic on the database. As to whether or not the "majority" of business apps are stored procedure oriented is very questionable, I've worked for years in finance and while I worked on stored procedure applications for sure, most apps were definitely just CRUD-based apps. The vast majority of apps we see for example in Django or Pyramid are most definitely CRUD based apps. Also, I use Pypy a lot, and at best I get about a 40-50% speedup. If we factor that into the profiling where I'm showing IO taking up about 5% of the time, that still produces an application that is very much CPU bound. If there's any point to take from the post, its the historical underpinnings of non-blocking IO, that we use it to poll a bunch of sleeping connections, where we have hundreds or thousands of them. It was never intended to be used on a small set of database connections and I think even if the database calls are slow, it will be very seldom that you'd see asynchronous context switching handling concurrency better than native threads.
- patronagezero 12y agoBenchmarks are snake oil when not being given the ability to reproduce them.
- zzzeek 12y agoDownload my suite and run them! Show me asyncio beating out threads in some database-centric scenario. I was really hoping to see that happen in some scenario or another.