3 ms·
While Ruby and Rails are slow, the issue is overblown. There is at most an order of magnitude difference between RoR and reasonable alternatives (php, python,
by gleb 19y ago
While Ruby and Rails are slow, the issue is overblown. There is at most an order of magnitude difference between RoR and reasonable alternatives (php, python, etc.), and realistacally the difference is closer to a factor of 3. This might sound important, but there is bigger fish to fry when talking about performance. All of the above are dead slow, 3-4 orders of magnitude slower than optimal C implementation.
In a typical web app, HTTP optimization and doing O(1) queries rather O(n^2) per page is where performance lies. You can develop web apps quickly these days, and the code can be clean, but you end up going from Palo Alto to Menlo Park through Paris. Sure, a supersonic plane can do that route quicker than a handicapped turtle, but the trick is not going through Paris altogether. RoR makes rewring the code to avoid the Paris trip easy, fast and resulting code remains reasonably readable. And that's the holy grail.
Having said that, that 3x performance boost to RoR would sure be nice, and would put more areas of our application into "Roundtrip through Paris OK" category.
- lupin_sansei 19y ago"In a typical web app, HTTP optimization and doing O(1) queries rather O(n^2) per page is where performance lies" Yes, I have found 99% of my speed increases from good database indexing and using hashtables to store data you need more than once.
- steve 19y agoIndeed, databases are real root of all performance problems. I rewrote a site to use the database much less frequently (mostly just for the initial loading and write operations) and I've been incredibly satisfied with the results.