3 ms·
I think the real problem with Rails and similar frameworks is the culture of not giving a shit about performance. I would never ever release a new version of an
by fauigerzigerk 16y ago
I think the real problem with Rails and similar frameworks is the culture of not giving a shit about performance. I would never ever release a new version of anything that is significantly slower than the previous one. It's simply a bug in my view.
But there are people who have convinced themselves that as long as it scales out, it doesn't matter how many servers you have to run. And if the reason is that something that's known statically is checked billions of times at runtime they don't care.
For a framework, the concept of premature optimization makes no sense.
- comice 16y agoYou'd never release a new version of anything that was slower? What if the new thing had 100x more (useful) features, should it still be as fast? Performance is a trade-off and sometimes it's worth compromising.
- fauigerzigerk 16y agoIf I'm writing a framework on which others depend in ways I cannot entirely foresee, then the old features _must_ perform as well or better than before. No compromises.
- lhnz 16y agoOut of interest, what language is your framework for? I'm seriously thinking of stopping using PHP because of the weight of the frameworks -- at least on Python there are microframeworks in which I am not left with a massive bottlenecks on the simplest Hello World page. Sure, you can scale but it's becoming ridiculous that I am forced to be so frugal with processor intensive tasks in the rest of the web application just because of the framework.
- fauigerzigerk 16y agoMy own framework and ORM writing days are long past and the software I write nowadays has very different constraints (data/text mining). I totally share your sentiment about having to be frugal because of wasteful frameworks. My approach is to prefer libraries over frameworks. I start out using the most bare-bones configuration possible (no frameworks, no ORM, no CMS, etc) and then I selectively add well maintained libraries created by people whose attitude I understand. I think code reuse is generally overrated, particularly when it comes to the rather trivial things that web frameworks do. This is probably not very helpful to you. I apologize.
- coolgeek 16y agohttp://codeigniter.com/ http://codeigniter.com/
- johnb 16y agoThat position of "no compromises" is probably why you're not writing a framework on which others depend. Complex software always involves compromises, especially general purpose frameworks used by a large population. Even if you're saying that only in performance there can be no compromises (but generally people who say things like no compromises don't bound those statements) it will cause large compromises in other areas, such a future feature development or long term maintainability and readability.
- fauigerzigerk 16y agoPerhaps you should leave comments about my personality to those who actually know me. But if you insist on talking about character traits, let me say this to you: People who don't know where to compromise and where not to comproise generally make bad software.
- asomiv 16y agoCompromises from whose point of view? One man's good compromise is another man's bad compromise.
- fauigerzigerk 16y agoAll I can do is state my own point of view as clearly as I can. And my point of view is already a compromise. I didn't say make it as fast as possible even if you have to rewrite it in assembly. I didn't even say, don't write it in Ruby. All I said is don't make it significantly slower than it was before. That doesn't seem like such a big ask.
- johnb 16y agoThat's a fair call - I don't know you and I am speaking about character traits. I don't feel your original comment reflected a position on knowing where to (or not) compromise, you made a strong assertion to take one option off the table in all situations. In my experience, developers who are make blanket rules up front about what can and can't be changed in the future development of a system don't end up making much of value. That's just my perspective, and I apologise if I've misread your character.
- DisposaBoy 16y agoIf that's taken as written then it's plain and simply impossible - no debate. I can understand that a significant slowdown might be a problem but otherwise it's just much ado about nothing really. What matters most is perceived performance degradation. I'd go as far as to presume? that most if not all people cannot actually the difference between an operation that takes (e.g) 100ms and one that takes 500ms yet when you look at the percentage difference it's clearly an unacceptable performance drop.
- philjackson 16y agoWouldn't we all be writing our web apps in C if we never allowed a performance degradation?
- fauigerzigerk 16y agoI don't see how you would come to that conclusion.
- rhizome 16y agoSome people do: it's called mod_perl. You can compile a stripped-down Apache (written in C) with mod_perl (also written in C) built in. This basically runs as a C http server that understands Perl, running the script within Apache process space. It's pretty darn close to the metal. The interpreter is the sticky part here and something for which Perl gets some criticism in this arena, but the Perl interpreter is also written in C and is quite fast, if not small. Bag on Perl all you like as a language, I know I do (and I use it, as well as Rails), but if you can get past the language hump mod_perl will knock you sideways. You can easily pump out a network card's worth of static content with a leftover desktop machine, and DBI is no slouch when it comes to integrating dynamic content. Slashdot, Valueclick, Craigslist, IMDB...all mod_perl.
- philjackson 16y agoYea, mod_perl isn't the same thing as writing your application in C, but anyway, my point was in reference to the parents comment: "I would never ever release a new version of anything that is significantly slower than the previous one. It's simply a bug in my view." I was trying to get across that we give some up performance for convenience now and again and it's fine to do so. I worked on the BBC iPlayer API which was written on mod_perl, by the way.
- mrcalzone 16y agoI don't have the links now, but both Google and Amazon have concluded that faster page loads result in more sales/conversions. If you want to render the whole page in the browser in a couple of seconds (Google webmaster tools indicates the "fast" threshold at 1.5 seconds), spending over half a second on the server-side seems like a big penalty.
- towelrod 16y agoThe problems here are manifesting on Ruby 1.8.7, but not 1.9.2. There have been big performance problems found with 1.8.7, for example in this issue: https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/6695 https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/... What was originally a performance optimization on 1.9.2 caused a terrible slowdown on 1.8.7. It was reported and fixed within two days. Does that still fit into your "not giving a shit about performance" critique? I think the "real problem" is that there are two major releases of MRI Ruby (not to mention JRuby) that have very different performance characteristics.
- nirvdrum 16y agoI think your example might actually support the parent's POV more than it refutes his stance. Exception handling isn't just slow in 1.8.7. It may be slower in 1.8.7 than 1.9.2, but exception handling is universally slow. There are a variety of reasons for this, but unrolling an exception is fundamentally slow and until there's native support for them on the die, that's likely to remain the case. So, creating a situation where you're guaranteeing an exception is raised during non-exceptional execution flow is generally a bad idea. It may be cleaner or more concise code-wise, but performance-wise it almost certainly will always be slower. For the most part I believe the parent is correct in that there is a much stronger emphasis placed on code conciseness/clarity than there is on avoiding performance anti-patterns. It's hard to measure whether the gains in "code agility" outweigh the local performance hit by making it easier to surface other performance problems. When there's less code involved it usually follows that it's easier to spot and fix problems. But I worry because my own experience suggests that death of a thousand cuts is a considerably harder situation to get out of than dealing with a handful of gnarlier bottlenecks.
- towelrod 16y ago>exception handling is universally slow. Except that exception handling is so fast in 1.9.2 that it made this change a performance optimization in 1.9.2. Look lower in this topic for benchmarks showing that Rails 3 is faster in 1.9.2 than rails2 is under 1.8.7. >performance-wise it almost certainly will always be slower Except, it wasn't slower in the Ruby that most people running Rails 3 should be running (1.9.2). I also point out, again, that they immediately fixed this problem when someone pointed out how slow it was in 1.8.7.
- DavidChouinard 16y agoHere's the way I look at it: computing is becoming exponentially cheaper, but good developers are incredibly expensive. Anything that makes the later more productive is overwhelmingly likely to be worth an increase in hardware cost (to cover up lost performance). The problem is that performance is an academically interesting problem to us geeks. We love to optimize, make quicker and oh-so clever.
- fauigerzigerk 16y agoI think this sharp antagonism between productivity and performance is a fallacy. It only works in the extremes. Making something slow doesn't automatically make it more productive to use. For framework writers to give some thought to performance issues does not make users of that framework less productive. Also, if you look at what just a few selective type hints in clojure can do to performance or how terse Scala code is, you have to come to the conclusion that performance and productivity can go hand in hand.
- btmorex 16y agoI guess you could take that viewpoint if you're planning on releasing your product 3 years from now (for example, that might be okay for a game developer with long product cycles), but 500ms to render a page is slow today. So, is the idea to wait 5 years so your page renders in a reasonable amount of time?
- moe 16y agoculture of not giving a shit about performance Yes. On top of that the ruby ecosystem also seems to attract a certain class of programmers who simply don't know how their magic ruby code translates to CPU, I/O and memory operations. My pet example is a certain popular rails auth framework that hits the database for every single request, to look up tokens that could simply be baked into the cookie. But there are plenty more - reviewing rails gems for performance is generally an exercise in frustration. It's a pity. Moore's Law mostly mitigates the low performance of MRI and we could be fine that way. But it can not mitigate a culture of incompetent design.
- enko 16y agoWell, this comment just comes across as sour grapes to me. You could be criticising any memory managed programming language. Old timers have been complaining about the kids not knowing about assembly, registers, punch cards, valves, etc since computers were invented. As for "incompetent design" - I don't know what you are on about. I think that Rails 3 is a frigging triumph of elegant, modular design. There are very many gems in the ruby ecosystem that I believe any unbiased person would say demonstrate exemplary design. In fact, I would say that the average rubyist is much more concerned with good design than, say, your average java dev. The whole reason I switched to ruby was because of the beauty of the language. And what is beauty but good design applied? Of course there are always exceptions but on the whole I think this comment is quite unfair.
- moe 16y agoYou could be criticising any memory managed programming language. No, I'm explicitly criticizing Ruby. I've spent years in Python-land and the average code quality (and btw documentation standard) is much higher over there. Which is not to say Python doesn't have its own problems, but less so in this particular area. say that the average rubyist is much more concerned with good design than, say, your average java dev. Good design is a relative term. In ruby I frequently see it interpreted as: Pack as many layers of magic as possible, and then test that with as many layers of testing-frameworks as possible. That's not too different from the common architecture-astronouting in java. One could argue it's just a different flavor. In either ecosystem the implementation of the actual business concerns ("What does this code actually do?") too often feels like an afterthought. Disclaimer: I'm not condemning either language. I like Ruby and use it a lot, but this is one aspect that I can't ignore.