Earlier quoted context omitted.
I'm the author of the original article. A typical server costs $1500 (DELL, HP) nowadays, but I've seen java apps commonly take up a whole rack of servers, not just one. This is a base cost of $30k and > $1500/mo for rackspace, A/C, power, bandwidth and maintenance. That's one-half of an FTE up-front and one FTE's salary reoccurring. I hear from java developers, "I'll need 6x 3Ghz, quad-core, dual-cpu machines for th…
That's one-half of an FTE up-front and one FTE's salary reoccurring. Only if your FTEs are very cheap. Most I know wouldn't get out of bed for less than $50k+. But even if it was half a man-year upfront and one recurring - that's still a no-brainer (remember we're talking an entire rack here, which goes quite a way for most apps). If that rack enables your 5 programmers to work only 10% faster (completely theoretical…
My latest anti-java rant
41–48 of 48 posts
Re: My latest anti-java rant
#42Earlier quoted context omitted.
The weird thing is how many projects resort to reference counting, which is just like GC only far more expensive (now every single p1=p2 requires two checks for null, an atomic increment and decrement, and a conditional branch around a dtor call!) and less reliable.
You say reference counting is far more expensive, but that's only in CPU cycles. Compare Python (reference-counted) and Java (garbage collected), and Java's memory use is 3x greater for similar programs, at least in my experience (also in the computer language benchmark game). Reference counting is a form of garbage collection, it's just eager rather than lazy, and that eagerness pays off in predictably lower memory…
Once your program's memory footprint is small enough to fit on the machines you're using, making it smaller takes more runtime work but has little benefit.
Re: My latest anti-java rant
#43The anti-GC part of this rant is especially hard to take. I've had the misfortune of having to debug various memory allocation problems in C. That's something I don't miss at all. To bag GC for performance without mentioning reliability is just wrong.
I'm the author of the original post. It's not difficult. Get a good debugger, and you're job is easy. Use a memory allocation tracker while you debug, then switch back when you're done. It's not hard, just takes a little more time. Don't be lazy. Use ccmalloc: No recompilation is needed to use ccmalloc; simply link it with -lccmalloc -ldl or ccmalloc.o -ldl When you've found and fixed your leak, stop linking with the…
Re: My latest anti-java rant
#44Earlier quoted context omitted.
I'd go further and say that readability and/or ease of use _often_ trumps efficiency. I/O tends to be the bottleneck at least as often as CPU, apart from anything else. I agree with the point about writing in assembly language. This rant is basically arguing for speculatively micro-optimising _every line of code_ by choosing a supposedly faster language.
I'm the author of the original post. The article isn't about optimizing every line of code, it's about not being lazy and choosing a language that you might have to do a little more work in for a massive decrease in bloat and execution time. One tool isn't always the right one for every problem. Don't use a hammer to screw in a screw. Sure, the screw will go in, but with just a little more effort (using a screwdriver…
Re: My latest anti-java rant
#45Earlier quoted context omitted.
I'm the author of the original post. I agree that I/O is going to be slow in any language, so I agree with you there. However, your point about a single server being equal to the salary of 4 FTEs, in my experience, we're not talking about a single machine. Commonly, we're talking about dozens or racks worth of machines. Now we're not talking pennies anymore. We're talking tens of thousands of dollars. This is wastefu…
Now we're not talking pennies anymore. We're talking tens of thousands of dollars. Do the math. If 4 devs cost $1500 in a day then "tens of thousands of dollars" is not much in comparison. I think you, like many devs including myself, might be suffering from "big figure anxiety". A $50k investment for a rack looks mighty intimidating at first. But break it down in excel and in most cases you'll find it turns out way…
One java programmer writes an app that takes a rack of equipment to run and writes it in 6 months. Meanwhile, a C programmer takes 12 months and only 1/2 rack of machines.
After a year, the java app costs $40k in programming costs and an initial cost of $60k for hardware, so $100k. A year later, hosting costs rack up another $18k. The C app costs $80k in programming costs, $30k for hardware, so $110k. A year later, hosting costs rack up another $9k, so we're about even. You may argue that C takes > 2 times to write, and I will argue that java bloat requires more than a 2x hardware purchase, so we're talking pretty much a wash here. I don't think that your cost argument holds much water.
Re: My latest anti-java rant
#46Earlier quoted context omitted.
I'm the author of the original article. What about bloat? It's hard to compare java to C applications because people don't tend to write the exact same app in more than one language, but compare Azurus to utorrent. Sure, Azurus has many more bells and whistles than utorrent does, but are you willing sacrifice an entire machine's CPU/memory to a single app just to get some special features? I doubt it. utorrent is the…
Somewhat tangentially: I run a useful app, JBidWatch (a nice, free eBay "sniping"/monitoring tool) on my Windows XP desktop. I started it 1 week ago following a reboot. One week later I noticed the PC's mem usage was nearing the amount of physical memory and investigated; one contributor turned out to be the JVM session running this app: according to Task Manager, this app (actively monitoring no items during the wee…
Re: My latest anti-java rant
#47Earlier quoted context omitted.
Now we're not talking pennies anymore. We're talking tens of thousands of dollars. Do the math. If 4 devs cost $1500 in a day then "tens of thousands of dollars" is not much in comparison. I think you, like many devs including myself, might be suffering from "big figure anxiety". A $50k investment for a rack looks mighty intimidating at first. But break it down in excel and in most cases you'll find it turns out way…
Let's say that servers cost $1500 each and a rack of 20 servers costs $1500/mo for hosting costs. Programmers make $80k/yr. Let's also say that C is twice as slow to develop for and let's say that Java requires twice as much hardware to run. One java programmer writes an app that takes a rack of equipment to run and writes it in 6 months. Meanwhile, a C programmer takes 12 months and only 1/2 rack of machines. After…
Moreover, going down the list of low hanging fruit in terms of reducing cost and rendering time per page-view the option to switch to a "more efficient" language is so far down the list that it's almost never reached. Indeed, it's often more important to switch to a language that makes it easier to scale out to more hardware than it is to switch to a language which is abstractly faster at individual optimizations (again, macro-optimization trumps micro-optimization). The biggest performance improvement efforts tend to be orthogonal to development language entirely. For example, tuning your database design and DB server parameters, using extensive caching, cutting down on http request overhead, etc.
It's telling that a company like facebook (which has no shortage of developer talent) chose to spend its efforts on making PHP faster by building a new compiler for it rather than moving away from PHP to some other hypothetically more efficient language.
Efficiency is an important factor in web development, it can affect end-user performance, costs, and profitability. But it's rarely as significant as many people make it out to be. It's more important to build something that people care about than it is to build something extremely efficient. For the vast majority of sites, increasing the popularity of your site by 10-100x is far more important than reducing the server footprint by 2x, or even 10x.
Re: My latest anti-java rant
#48Earlier quoted context omitted.
Now we're not talking pennies anymore. We're talking tens of thousands of dollars. Do the math. If 4 devs cost $1500 in a day then "tens of thousands of dollars" is not much in comparison. I think you, like many devs including myself, might be suffering from "big figure anxiety". A $50k investment for a rack looks mighty intimidating at first. But break it down in excel and in most cases you'll find it turns out way…
Let's say that servers cost $1500 each and a rack of 20 servers costs $1500/mo for hosting costs. Programmers make $80k/yr. Let's also say that C is twice as slow to develop for and let's say that Java requires twice as much hardware to run. One java programmer writes an app that takes a rack of equipment to run and writes it in 6 months. Meanwhile, a C programmer takes 12 months and only 1/2 rack of machines. After…
In most companies you don't have one programmer per rack but many programmers per rack. The hosting costs are usually dwarfed by the programmer salaries, often as much as to make the former appear as a rounding error.
Consequently you should in almost all cases optimize for developer-performance, not for software performance.