5 ms·
I still don't get why anyone would brag about how poorly they optimized something the first time around.
by CyberDildonics 11y ago
I still don't get why anyone would brag about how poorly they optimized something the first time around.
- davidgrenier 11y agoBecause 1M req/s web severs are just flying about? I'm totally out of date on such thing but last I read we had Yaws built off Erlang and nginx at around 80k? There must really be something I didn't understand here.
- KirinDave 11y agoSome people deeply commit to micro-benchmarks. And sure, netty wins the micro-benchmark. But Java's concurrency model is harder to get right AND fast, so maybe it's a wash for real programs? You can just be assured that ASP.NET is not going to suplex you with poor performance.
- jongalloway2 11y agoASP.NET wasn't necessarily slow previously - for example, StackOverflow is running on it, and they're getting some pretty good perf (albeit with pretty beefy machines): http://nickcraver.com/blog/2016/02/17/stack-overflow-the-architecture-2016-edition/ http://nickcraver.com/blog/2016/02/17/stack-overflow-the-arc... Most sites, even relatively high traffic sites, don't serve 50k requests per second. However, it wasn't granular or modular. For a lot of sites, it was a good balance of features to performance, but in a lot of cases you paid a performance penalty for features you weren't using. That includes the memory footprint penalty - each ASP.NET site loaded up a chunky system.web DLL with the kitchen sink. Back in the day that was fine, but as there are a lot of front-end heavy sites now that use servers mostly as API endpoints, and package managers are pretty standard, devs like to only pay the performance cost (including memory footprint) for the features, middleware, etc., that they're using. That was a big design consideration for ASP.NET Core, and you can really see the results in these specific benchmarks (Techempower plaintext).
- kristianp 11y agoSpeaking of performance. I read that blog entry, and saw that they use their own DB library called Dapper: https://github.com/StackExchange/dapper-dot-net https://github.com/StackExchange/dapper-dot-net I was suprised to see that it's almost 4x faster than linq2sql and more than 10x faster than entity framework. (according to the table "Performance of SELECT mapping over 500 iterations - POCO serialization"). There must be a lot of slow sites out there running on entity.
- jongalloway2 11y agoThey're different kinds of tools - maybe like comparing an RV to a motorcycle, or a guided missile to a sniper rifle. Or a... Well, anyhow, while at a high level they're both tools that map between database commands and statically typed objects, the approach is very different. Entity Framework is a full object relational mapper - it's generally the active record pattern, and it supplies things like migrations and entity tracking. The design philosophy is to abstract the database mechanics as much as possible, so you just work with collections of objects (e.g. DbSet<Person>) - add new Person instances to the set, set properties on them, etc. EF converts your intent into database commands (SQL queries in many cases, although EF7 supports some non-relational databases and in-memory storage, too). EF is tracking the state of all your objects, so it knows whether they need to be updated in the data store. That might be fine for a lot of cases - if you're managing a small list of products or customers, working on an intranet app, etc., you're not going to see a difference. I've seen (and fixed) a lot of horrible SQL queries that intranet devs built by concatenating strings; EF is at least going to usually give you decent, secure SQL. (If you're gnashing your teeth right now because EF crushed your dreams in the past, they've done some decent work on SQL generation lately, including some good stuff in EF7). It works pretty well on a lot of apps in lots of dev shops, and can be tuned to work well on big apps if you know what you're doing. Dapper, and other "micro-ORMs" want to work closer to the metal. Dapper's tuned to taking the results of a database command (SQL query) and populate static objects. There's no entity tracking, state management, etc. Take results of a database query, stuff it into a bunch of object properties, walk away. Because of that, benchmarks showing the performance of select mapping over 500 iterations - POCO serialization are going to run a lot faster, just as (sorry, can't help myself) a motorcycle's going to beat an RV on a race down a tiny dirt trail. So there may be some slow sites that are running on EF that would be faster on Dapper, but not without evaluating how they're interacting with the database, how they're doing database updates, etc. Also, to be fair, you can disable a lot of features in EF (or other more fully featured ORMs) and get perf numbers pretty close to micro-ORM's like Dapper. See this comparison: https://github.com/StackExchange/dapper-dot-net/issues/246#issuecomment-90598911 https://github.com/StackExchange/dapper-dot-net/issues/246#i... However, if you're turning off all the features and hand crafting SQL statements and working with untracked entities, you probably want a micro-ORM, anyways.
- KirinDave 11y agoYou have to remember though that part of this is making the core features of a new build of a runtime with new features get massive improvements to performance. It's exciting for ASP.NET, but part of this is also to say, "The .NET Core platform is not a joke. In fact it's a good deploy target."