What business does he have voicing radio shows? Dead people need to be reminded of their place. Why, in my day, dead people didn't just gallavant about and muck up perfectly good radio stories. No sir, they stayed in the box (or urn) where they belonged, and were happier for it! We had a word for it - yax, which means (loosely) "person who is dead and shouldn't be doing any more voice-overs, but does them anyway out of some overblown sense of self worth".
My contention is not that DRM is good or the RIAA is right, but solely that Mr. Doctorow did not provide any convincing reasons for people to stop pursuing DRM.
Yes he does. It's really simple.
Given the fact that DRM has never, ever, ever stopped determined attackers from breaking in, DRM merely ends up inconveniencing the honest people. And the people who are honest and are paying for your content are otherwise known as your "customers". So if you add all this DRM that inconveniences your customers, and doesn't stop people who are determined to rip you off, it doesn't do you good. It harms you.
"Mr. Doctorow makes a fine case about the futility of DRM, but does not make any convincing business argument for those who want DRM or make DRM that they will be better off without it."
The fact that it is futile is itself a convincing business argument against it.
To simplify it even further: Honey costs money, sonny. Doctorow didn't show them how they can make more money, so they're not going to put out any honey.
Err.... actually, DRM costs money. It costs money to implement these schemes, that, in the end, even you have admitted are probably futile. Furthermore, the more DRM you put in, the more you inconvenience your honest customers, whereas you don't stop the pirates, or even slow them down considerably. All that was in the speech. You haven't even bothered to try to dispute it, yet you say you "attacked his arguments head on". You haven't even come close.
at times their vaguely socialist emotional bias pops up pretty heavily
Hehe, yeah, like with The McLaughlin group, and Firing line. John McLauglin and William Buckley sure are commie pinkos aren't they? Good think John has Eleanor Clift for "balance".
The first amendament doesn't say you have to speak the truth.
No, but libel and slander laws do. In fact, there are only two ways to win against a libel or slander accusation: that the statement in question was true, or that the person who said it had a reasonable expectation that it was true and aired it in good faith.
What's disturbing is that, in the story, a Pew survey was cited stating that:
21 percent of adults ages 18 to 29 said they regularly turn to "The Daily Show" and "Saturday Night Live" for presidential campaign news.
Actually, the daily show is a pretty good news source. I read a lot of different news sources, and they cover things which aren't covered a lot in the traditional media. Sure, they are also a comedy, but they don't make stuff up.
Do you work for the RIAA? Before you answer that I am attacking you ad hominem, working for the RIAA is not an insult, a priori. Anyway, this is what you wrote.
What success? The issue is the success of ITunes relative to existing music sales, not that of ITunes itself.
You write that as though it is an established fact. Your premise is that the music industry is making less money than it is owed, as though there is a social contract between us and them to give them money.
There are a few reasons why this is wrong. First of all, if you are the music industry, these people are your customers. If you accuse your customers of being thieves, they won't like it very much. It's bad business, even if it were true.
Secondly, you must be making some sort of assumption about the dropping record industry sales and "theft of IP", as you would put it, as though the sales would be much higher but for everyone "stealing it". Am I correct in my assumption here?
You fail to see that $16 is a lot of money to most people. The minimum wage is still $5.15. If you make that much money, you practically can't buy that Beatles cd (which are still priced sky-high), because you won't be able to catch that new Tom Cruise movie. Entertainment is a discretionary, budgetary item. There's only so much people will pay for it, and some bad will goes a long way, as there has been with the music industry.
Take my case for example. I don't download illegally. I admit that I have downloaded music off of P2P in the past. I stopped that years ago, when I realized that it was the wrong thing to do, and I deleted all the music I had gotten that way. From that time on, I only bought 2 CDs. They were both new albums from my favorite bands, which I would have bought in any case.
People like to support their favorite bands, they like to think of them as successful and they like to participate in that success. Even when I downloaded cds, I never downloaded my favorite bands. I bought the cds, and paid an exorbitant amount for them, grudgingly. You'll say that I am alone in that regard, but I'm not. I know I'm not because I know several other people who feel the same way.
Now I have ITunes, and I've got basically what I wanted the whole time, and I can support my favorite artists too. The RIAA is gonna make good money from me, and I hate that fact because I hate what they stand for. If it were not for ITunes, they would only get about $30 per year out of me, for my favorite bands' releases.
If the RIAA managed to quash downloading altogether, they might manage to squeeze out a little extra money. Some people really do just download everything and feel good about it. But there are more people like me than are accounted for in their "studies".
People have the chance to pay already. What you're saying that people should be able do is dictate what artists are willing to sell, against their will.
The artists? Get real. You mean the industry. Can you really say that the artists wouldn't rather give people the option to download their music for a fee? You speak for them? If that's not what you're saying, what is it?
Au contraire, sir, I tackled it head on and ground it to a fine powder. Mr. Doctorow makes a fine case about the futility of DRM, but does not make any convincing business argument for those who want DRM or make DRM that they will be better off without it.
Business is about people. You catch more flies with honey than with vinegar. I know, it's old, and it's corny, but it's true. If you try to force people into your business model because you control something that you think they are forced to pay for, and you feel that they owe you money just by existing, you just might find out that you were wrong, in the end. Cory's argument was about human psychology. You say you attacked it head on, but all you did was spout a bunch of assumptions as fact. Give me a break, you didn't even bother to cite any RIAA studies.
Yeah, but now the cost of copying is *zero*. Unlike Bibles, piano rolls, and videotapes, it's really, really tough to build a business model on zero.
You (implicitly, sarcastically) complain about recycled arguments, yet here you are doing the same thing. You have this notion that people just won't pay for what they can get for free (you would probably say steal). How do you explain then, the incredible success of ITunes? Do you think ITunes would be less successful if it didn't have light DRM?
It's obvious you have a very cynical view of human nature. I say give people half a chance and they'll be happy to pay for content. Limit their options, and they'll go around you to get what they want. That was the thrust of Doctorow's argument, and one which you can't refute merely by ignoring it. The more restrictions you lay on, the more annoyed your actual customers (you know, the ones who keep you in the biz) are going to get, and in the end you only hurt your best customers, you don't stop infringement.
Perfect example: CD in-the-drive copy protection for games. Why does it continue? I pay for all my games and it annoys the hell out of me that I have to keep up with that plastic disc. Does it stop the people who are bound and determined to rip off the authors? No. A crack comes out the same day the game is released, and that's all there is to it. Furthermore, if I, the legitimate purchaser, run a crack so I don't have to dig up the stupid CD for a game I haven't played in a year, I'm violating the law.
Put it in hardware, smart people will find a way around that too.
Did you even read the speech? It sure doesn't seem that way.
I think the author was being funny. I certainly found this to be hilarious.
Harlan is a genius when it comes to writing, no doubt about it. However, when it comes to dealing with people, he is an ass.
My father and stepmother went to one of his book signings. Long story short - he hit on my stepmother, and offered to feed a guy his camera who took a picture of him. A real class act, that guy. He'll probably sue me for posting this. Bring it on, tough guy!
For electing corporate owned political hacks like Orrin Hatch. When creativity stops to a standstill, except for other corporate owned entities like Britney Spears who everyone laughingly calls creative, and the only thing you can hear on the radio is meaningless, souless pap, and movies are all made by commitee, and to watch them you have to pay $10 for a disk that will only work one time, well, I'm just going to say "I don't care". Because none of you care enough to wake up and realize that there really IS a difference between the parties, and they're not all the same. "Get government off our backs" just means stepping aside to let the corporations screw us all over, it doesn't mean getting out of our bedrooms at night, or giving us the airwaves which belong to us, or lowering taxes on anybody except the fabulously wealthy third-generation members of the soon-to-be heriditary ruling class. No, it means propping up the agriculture giants with price supports under the guise of protecting "the little farmer", it means allowing any sort of pie-in-the-sky dream of the mega corporations to keep you from enjoying the rights that are yours by birth. It means allowing state sponsored monopolies to flourish long past the time when they were supposed to be subject to competition, and letting them charge (extort) five dollars from you to NOT publish your phone number.
You all got what you deserve because in the end, you don't care, and you don't pay attention. Screw my karma, and screw Orrin Hatch, and to hell with anyone who voted for that bastard son of a bitch.
The movie thing, I think is different, as would most other forms of copying.
But you didn't show how it is different. Your example was the rewriting of a novel in a substantially similar way. The example we are talking about is an alternate *performance* of a movie, which is completely analogous to an alternate performance of a musical work.
But you fail to attack the meaty arguments in the speech. Sure, it's stuff we've all seen before, but your reaction doesn't bear a whole lot of resemblence to the actual article.
One point you fail to address is that competition and innovation are good, in the end, for the artists. When VHS machines came out, the MPAA screamed that it was the end of the universe and they were going to take their marbles and go home if congress didn't stop it. Well, lo and behold, an entire industry was created for renting and selling videos which not only added to the MPAA's bottom line, but in some cases actually surpassed box office sales. The very industry screaming for ARM (analog rights management) actually ended up benefiting greatly from the thing they were trying to control, because they lacked the vision to see what it would do for them.
I'm not going to sit here and pick apart your strawman, you seem pretty proud of it. I'll just say that where it even resembles the very insightful speech Cory gave, it's too simplistic to be considered anything other than a (*cough*) troll.
If you want the utmost performance and second best won't cut it then we're talking about 0.001% of computing applications already
Yes, that's true, but the article that this thread is about made the (IMO outrageous) claim that "optimized c++" performed worse than java, when all he meant by optimized was a compiler switch (and probably the wrong compiler switch, at that). This is a far cry from demonstrating that java is superior to hand coded c++ optimization (which could even involve writing self-modifying assembly code).
and we're probably talking about C, not C++.
Nah. Usually with apps that require top performance, the engineers will optimize their inner loops, and maybe even add some assembly code (which, as I'm sure I don't have to point out - you can't do in java).
The part I get emotional about is the absolutists who can't believe Java could ever be better than C++ in any way.
Yeah, and I must admit guilt for stirring up the pot a bit. Looking back at my original post, it seems like that was what I was saying, even though it wasn't what I was saying.
Naive java can definitely be faster than essentially the same code in c++. That's a fact, and I don't think anyone is disputing it. The author (troll?) of the/. story just pushed my buttons with his terminology. His idea of "optimized c++" was a compiler switch, and there is so much more to optimizing than that, it just is not funny. I wonder if he knows what a pipeline stall is? My guess is no, given the sorry state of his "optimized" code (well covered by others in this thread).
With c++, you can take advantage of architecture specific optimizations
You have that in Java as well. The JVM, being part of Java, is certainly allowed to be written differently for different architectures -- and the HotSpot VMs by extension can re-arrange the machine code it JIT'ed to be more optimal for the hardware at hand.
You replied with a non-sequitur. What I said is that in c++, you, the developer can take advantage of the hardware. What you replied with is that the JVM can take advantage of the native hardware too. Don't you see how those two things are not equivalent?
With Java, you let the friggin machine do the work of optmizing it for where you're deploying.
Yes, and that's great, and it's well suited to certain tasks. However, a general purpose run-time profiler/optimizer is not going to outperform a proficient human. When you absolutely need to count every clock cycle, like if you were writing Doom 3, f'rinstance, you simply can't rely on a smart JIT compiler. The profiling itself is a performance hit. If you knew enough about to Java architecture to implement your algorithm in the most optimal way from the start, the profiler would slow down the run-time.
With c++, you can examine the native code, and if the compiler does something stupid, you can drop down into assembly and get your hands dirty removing pipeline stalls, making sure your inner loop fits in the cache, and other stuff that you just have to hope the JVM will do for you if you are a java programmer. If the JVM does the wrong thing, you're stuck.
I'm not trying to knock what is obviously a highly favored language of yours; believe it or not I've written some Java myself, and I'm not a language bigot. I'm just saying, use it for what it's intended to do. Fastest performance isn't it. Reasonable performance with good cross platform compatibility is the best you can hope for, and all it was ever intended for.
You see, runtime profiling has the ability to examine the state of the program as its running and respond to changing conditions with chaning optimizations.
I know what it is. Your claim that it is faster to profile and recompile in runtime rather than to write well-optimized native code is what I think is rather funny. If it really was faster, Carmack would write D3 in Java.
No, it's a trick to make non-native code run faster. That's all it is. Does it make java faster than it otherwise would? Yes (but only sometimes - do I need to explain to you the cases where it would actually make the code slower?). Does it make Java faster than hand-optimized c++? Not by a damn sight.
You ask me how a c++ programmer could optimize a program for every possible input.
First of all, Java doesn't do that. If it did, it would eat all your available memory very quickly. In some situations, it might find a loop invariant and optimize the code accordingly. Every loop doesn't necessarily even have an invariant that your magical java profiler can optimize away.
Secondly, what you are talking about is a very general approach to optimization. What I am talking about is knowing your architecture and tweaking your code to run as fast as possible on a given CPU. You just can't do that with Java, you have to hope that your JVM does it for you. Can you guarantee that you won't get a pipeline stall because your runtime optimizer is so bad ass? Do you even know what a pipeline stall is? Can you make sure that your critical code fits into the cpu cache? Can you be sure that the JVM will do it for you?
Can you write native code in java for the times when your compiler does the wrong thing (aka assembly code)? You can with just about every c++ compiler (even gnu!), but you can't do it with Java, period.
Son, I don't have time to educate you. If you really want to learn, instead of running your mouth off here on slashdot, pick up a book on the Intel hardware (or your favorite cpu), and play around with it.
Right, so you're saying that every language other than C++ is irrellevant?
Not at all. Different languages and compilers are best suited for different tasks. Performance is not one of Java's advantages, certainly not when compared to c++. That's what I'm saying. I'm all in favor of using the best tool to solve the problem. When it comes to cutting-edge performance, that tool is c++ (probably with some assembly code too).
*sigh* have you people never heard of runtime optimisations?
Have you never heard of self modifying code? Look it up. You can do it in c++. You cannot do it in Java.
But really, the question here is whether a generic run-time profiling algorithm can outperform a human with time on his (or her) hands and a good profiler. Why isn't Carmack writing Doom 3 in Java? Is it because he is biased and religious? Or is it maybe because the performance isn't there?
With c++, you can take advantage of architecture specific optimizations. What you are talking about are algorithmic optimizations, which are good, and make java perform better than it otherwise would, but can't approach the performance that a skilled technician in the art can get from c++ by writing well optimized code and profiling the actual generated assembly code.
Furthermore, the specific optimizations you name could be implemented in c++. The compiler won't do it for you, but a clever enough developer could do them, and the end result would outperform Java because there isn't a virtual machine profiling the executable constantly, trying to figure out what to do.
My point is that proper design-time optimization is going to be better than compile-time optimization no matter what. No algorithm can yet approach the intelligence of a human when it comes to optimizing.
We're arguing about seperate things. You seem to view optimization as something the compiler does, and this seems to be a common view amongst java programmers. Real optimization involves knowing your compiler, knowing your architecture, and writing smart code to take advantage of both. No matter how smart you are, you can't take advantage of your architecture in Java. You have to rely on Java to do it for you. The whole point of java is to remove you, the developer, from the architecture.
But I never said otherwise. I said that optimized c++ would outperform Java, every time. This is different from compiler optimization. In that regard, I agree with you.
Let's turn the languages around. Suppose we write a VM in Java, which runs byte code compiled from C++ programs. Then it can profile the running C++ byte code and optimize the critical sections. A C++ compiler that translates directly to machine code cannot do that.
Maybe the compiler can't, but the developer could write code that would do as well or better than any sort of JVM specific optimization you can name. The JVM is not going to outperform John Karmack by doing run-time profiling. If you think Doom 3 could be written in Java, you're kidding yourself. Seriously, do you think a run-time profiling algorithm can do better than a proficient human with a profiling tool?
Thank you, Tiny Tim. Would you like some pudding?
Now I can read /. duplicates on my way to Houston. Like this one!
Let's just hope Douglas doesn't pull an L. Ron and start publishing books again.
Get a lif.... errr.... never mind.
Yes he does. It's really simple.
Given the fact that DRM has never, ever, ever stopped determined attackers from breaking in, DRM merely ends up inconveniencing the honest people. And the people who are honest and are paying for your content are otherwise known as your "customers". So if you add all this DRM that inconveniences your customers, and doesn't stop people who are determined to rip you off, it doesn't do you good. It harms you.
"Mr. Doctorow makes a fine case about the futility of DRM, but does not make any convincing business argument for those who want DRM or make DRM that they will be better off without it."
The fact that it is futile is itself a convincing business argument against it.
To simplify it even further: Honey costs money, sonny. Doctorow didn't show them how they can make more money, so they're not going to put out any honey.
Err.... actually, DRM costs money. It costs money to implement these schemes, that, in the end, even you have admitted are probably futile. Furthermore, the more DRM you put in, the more you inconvenience your honest customers, whereas you don't stop the pirates, or even slow them down considerably. All that was in the speech. You haven't even bothered to try to dispute it, yet you say you "attacked his arguments head on". You haven't even come close.
Hehe, yeah, like with The McLaughlin group, and Firing line. John McLauglin and William Buckley sure are commie pinkos aren't they? Good think John has Eleanor Clift for "balance".
No, but libel and slander laws do. In fact, there are only two ways to win against a libel or slander accusation: that the statement in question was true, or that the person who said it had a reasonable expectation that it was true and aired it in good faith.
Actually, the daily show is a pretty good news source. I read a lot of different news sources, and they cover things which aren't covered a lot in the traditional media. Sure, they are also a comedy, but they don't make stuff up.
What success? The issue is the success of ITunes relative to existing music sales, not that of ITunes itself.
You write that as though it is an established fact. Your premise is that the music industry is making less money than it is owed, as though there is a social contract between us and them to give them money.
There are a few reasons why this is wrong. First of all, if you are the music industry, these people are your customers. If you accuse your customers of being thieves, they won't like it very much. It's bad business, even if it were true.
Secondly, you must be making some sort of assumption about the dropping record industry sales and "theft of IP", as you would put it, as though the sales would be much higher but for everyone "stealing it". Am I correct in my assumption here?
You fail to see that $16 is a lot of money to most people. The minimum wage is still $5.15. If you make that much money, you practically can't buy that Beatles cd (which are still priced sky-high), because you won't be able to catch that new Tom Cruise movie. Entertainment is a discretionary, budgetary item. There's only so much people will pay for it, and some bad will goes a long way, as there has been with the music industry.
Take my case for example. I don't download illegally. I admit that I have downloaded music off of P2P in the past. I stopped that years ago, when I realized that it was the wrong thing to do, and I deleted all the music I had gotten that way. From that time on, I only bought 2 CDs. They were both new albums from my favorite bands, which I would have bought in any case.
People like to support their favorite bands, they like to think of them as successful and they like to participate in that success. Even when I downloaded cds, I never downloaded my favorite bands. I bought the cds, and paid an exorbitant amount for them, grudgingly. You'll say that I am alone in that regard, but I'm not. I know I'm not because I know several other people who feel the same way.
Now I have ITunes, and I've got basically what I wanted the whole time, and I can support my favorite artists too. The RIAA is gonna make good money from me, and I hate that fact because I hate what they stand for. If it were not for ITunes, they would only get about $30 per year out of me, for my favorite bands' releases.
If the RIAA managed to quash downloading altogether, they might manage to squeeze out a little extra money. Some people really do just download everything and feel good about it. But there are more people like me than are accounted for in their "studies".
People have the chance to pay already. What you're saying that people should be able do is dictate what artists are willing to sell, against their will.
The artists? Get real. You mean the industry. Can you really say that the artists wouldn't rather give people the option to download their music for a fee? You speak for them? If that's not what you're saying, what is it?
Au contraire, sir, I tackled it head on and ground it to a fine powder. Mr. Doctorow makes a fine case about the futility of DRM, but does not make any convincing business argument for those who want DRM or make DRM that they will be better off without it.
Business is about people. You catch more flies with honey than with vinegar. I know, it's old, and it's corny, but it's true. If you try to force people into your business model because you control something that you think they are forced to pay for, and you feel that they owe you money just by existing, you just might find out that you were wrong, in the end. Cory's argument was about human psychology. You say you attacked it head on, but all you did was spout a bunch of assumptions as fact. Give me a break, you didn't even bother to cite any RIAA studies.
Music is about people. It'
You (implicitly, sarcastically) complain about recycled arguments, yet here you are doing the same thing. You have this notion that people just won't pay for what they can get for free (you would probably say steal). How do you explain then, the incredible success of ITunes? Do you think ITunes would be less successful if it didn't have light DRM?
It's obvious you have a very cynical view of human nature. I say give people half a chance and they'll be happy to pay for content. Limit their options, and they'll go around you to get what they want. That was the thrust of Doctorow's argument, and one which you can't refute merely by ignoring it. The more restrictions you lay on, the more annoyed your actual customers (you know, the ones who keep you in the biz) are going to get, and in the end you only hurt your best customers, you don't stop infringement.
Perfect example: CD in-the-drive copy protection for games. Why does it continue? I pay for all my games and it annoys the hell out of me that I have to keep up with that plastic disc. Does it stop the people who are bound and determined to rip off the authors? No. A crack comes out the same day the game is released, and that's all there is to it. Furthermore, if I, the legitimate purchaser, run a crack so I don't have to dig up the stupid CD for a game I haven't played in a year, I'm violating the law.
Put it in hardware, smart people will find a way around that too.
Did you even read the speech? It sure doesn't seem that way.
Harlan is a genius when it comes to writing, no doubt about it. However, when it comes to dealing with people, he is an ass.
My father and stepmother went to one of his book signings. Long story short - he hit on my stepmother, and offered to feed a guy his camera who took a picture of him. A real class act, that guy. He'll probably sue me for posting this. Bring it on, tough guy!
2) Frito lay has announced they will begin to manufacture "computer chips", a new semiconducting snack to monitor your diet
3) Western digital announces that their new line of "hard drives" will dispense viagra (or cialis, based on customer preference)
4) Dragon announces a new line of "motherboard" which will actually reproduce and bear children
You all got what you deserve because in the end, you don't care, and you don't pay attention. Screw my karma, and screw Orrin Hatch, and to hell with anyone who voted for that bastard son of a bitch.
But you didn't show how it is different. Your example was the rewriting of a novel in a substantially similar way. The example we are talking about is an alternate *performance* of a movie, which is completely analogous to an alternate performance of a musical work.
One point you fail to address is that competition and innovation are good, in the end, for the artists. When VHS machines came out, the MPAA screamed that it was the end of the universe and they were going to take their marbles and go home if congress didn't stop it. Well, lo and behold, an entire industry was created for renting and selling videos which not only added to the MPAA's bottom line, but in some cases actually surpassed box office sales. The very industry screaming for ARM (analog rights management) actually ended up benefiting greatly from the thing they were trying to control, because they lacked the vision to see what it would do for them.
I'm not going to sit here and pick apart your strawman, you seem pretty proud of it. I'll just say that where it even resembles the very insightful speech Cory gave, it's too simplistic to be considered anything other than a (*cough*) troll.
Quite true. I'm pretty sure the data travels at about 186,000 miles per second.
Yes, that's true, but the article that this thread is about made the (IMO outrageous) claim that "optimized c++" performed worse than java, when all he meant by optimized was a compiler switch (and probably the wrong compiler switch, at that). This is a far cry from demonstrating that java is superior to hand coded c++ optimization (which could even involve writing self-modifying assembly code).
and we're probably talking about C, not C++.
Nah. Usually with apps that require top performance, the engineers will optimize their inner loops, and maybe even add some assembly code (which, as I'm sure I don't have to point out - you can't do in java).
Yeah, and I must admit guilt for stirring up the pot a bit. Looking back at my original post, it seems like that was what I was saying, even though it wasn't what I was saying.
Naive java can definitely be faster than essentially the same code in c++. That's a fact, and I don't think anyone is disputing it. The author (troll?) of the /. story just pushed my buttons with his terminology. His idea of "optimized c++" was a compiler switch, and there is so much more to optimizing than that, it just is not funny. I wonder if he knows what a pipeline stall is? My guess is no, given the sorry state of his "optimized" code (well covered by others in this thread).
- With c++, you can take advantage of architecture specific optimizations
You have that in Java as well. The JVM, being part of Java, is certainly allowed to be written differently for different architectures -- and the HotSpot VMs by extension can re-arrange the machine code it JIT'ed to be more optimal for the hardware at hand.You replied with a non-sequitur. What I said is that in c++, you, the developer can take advantage of the hardware. What you replied with is that the JVM can take advantage of the native hardware too. Don't you see how those two things are not equivalent?
With Java, you let the friggin machine do the work of optmizing it for where you're deploying.
Yes, and that's great, and it's well suited to certain tasks. However, a general purpose run-time profiler/optimizer is not going to outperform a proficient human. When you absolutely need to count every clock cycle, like if you were writing Doom 3, f'rinstance, you simply can't rely on a smart JIT compiler. The profiling itself is a performance hit. If you knew enough about to Java architecture to implement your algorithm in the most optimal way from the start, the profiler would slow down the run-time.
With c++, you can examine the native code, and if the compiler does something stupid, you can drop down into assembly and get your hands dirty removing pipeline stalls, making sure your inner loop fits in the cache, and other stuff that you just have to hope the JVM will do for you if you are a java programmer. If the JVM does the wrong thing, you're stuck.
I'm not trying to knock what is obviously a highly favored language of yours; believe it or not I've written some Java myself, and I'm not a language bigot. I'm just saying, use it for what it's intended to do. Fastest performance isn't it. Reasonable performance with good cross platform compatibility is the best you can hope for, and all it was ever intended for.
I know what it is. Your claim that it is faster to profile and recompile in runtime rather than to write well-optimized native code is what I think is rather funny. If it really was faster, Carmack would write D3 in Java.
No, it's a trick to make non-native code run faster. That's all it is. Does it make java faster than it otherwise would? Yes (but only sometimes - do I need to explain to you the cases where it would actually make the code slower?). Does it make Java faster than hand-optimized c++? Not by a damn sight.
You ask me how a c++ programmer could optimize a program for every possible input.
First of all, Java doesn't do that. If it did, it would eat all your available memory very quickly. In some situations, it might find a loop invariant and optimize the code accordingly. Every loop doesn't necessarily even have an invariant that your magical java profiler can optimize away.
Secondly, what you are talking about is a very general approach to optimization. What I am talking about is knowing your architecture and tweaking your code to run as fast as possible on a given CPU. You just can't do that with Java, you have to hope that your JVM does it for you. Can you guarantee that you won't get a pipeline stall because your runtime optimizer is so bad ass? Do you even know what a pipeline stall is? Can you make sure that your critical code fits into the cpu cache? Can you be sure that the JVM will do it for you?
Can you write native code in java for the times when your compiler does the wrong thing (aka assembly code)? You can with just about every c++ compiler (even gnu!), but you can't do it with Java, period.
Son, I don't have time to educate you. If you really want to learn, instead of running your mouth off here on slashdot, pick up a book on the Intel hardware (or your favorite cpu), and play around with it.
Not at all. Different languages and compilers are best suited for different tasks. Performance is not one of Java's advantages, certainly not when compared to c++. That's what I'm saying. I'm all in favor of using the best tool to solve the problem. When it comes to cutting-edge performance, that tool is c++ (probably with some assembly code too).
Have you never heard of self modifying code? Look it up. You can do it in c++. You cannot do it in Java.
But really, the question here is whether a generic run-time profiling algorithm can outperform a human with time on his (or her) hands and a good profiler. Why isn't Carmack writing Doom 3 in Java? Is it because he is biased and religious? Or is it maybe because the performance isn't there?
With c++, you can take advantage of architecture specific optimizations. What you are talking about are algorithmic optimizations, which are good, and make java perform better than it otherwise would, but can't approach the performance that a skilled technician in the art can get from c++ by writing well optimized code and profiling the actual generated assembly code.
Furthermore, the specific optimizations you name could be implemented in c++. The compiler won't do it for you, but a clever enough developer could do them, and the end result would outperform Java because there isn't a virtual machine profiling the executable constantly, trying to figure out what to do.
My point is that proper design-time optimization is going to be better than compile-time optimization no matter what. No algorithm can yet approach the intelligence of a human when it comes to optimizing.
We're arguing about seperate things. You seem to view optimization as something the compiler does, and this seems to be a common view amongst java programmers. Real optimization involves knowing your compiler, knowing your architecture, and writing smart code to take advantage of both. No matter how smart you are, you can't take advantage of your architecture in Java. You have to rely on Java to do it for you. The whole point of java is to remove you, the developer, from the architecture.
(1) Do a google for "John Carmack".
(2) Do I really need a (2)?
But I never said otherwise. I said that optimized c++ would outperform Java, every time. This is different from compiler optimization. In that regard, I agree with you.
Maybe the compiler can't, but the developer could write code that would do as well or better than any sort of JVM specific optimization you can name. The JVM is not going to outperform John Karmack by doing run-time profiling. If you think Doom 3 could be written in Java, you're kidding yourself. Seriously, do you think a run-time profiling algorithm can do better than a proficient human with a profiling tool?