"Stop the world" garbage collection for this app usually takes less than 13ms.
"Usually" isn't good enough, not when "usually" just made you drop a video frame or overrun a sound buffer. Out of curiosity, though, what language is this? Experiences I have had with Java involved watching the GUI freeze when garbage collection happens. I would be happy to hear that GC wait times had indeed gotten this fast, though it's also likely that your fast GC is a result of your particular allocation patterns.
Modern GC is *faster* than hand-coded free calls in 90% of situations.
Greater throughput at the expense of latency. GC stops the world.
"A major reason for this is that the garbage collector allows the runtime system to amortize allocation and deallocation operations in a potentially advantageous fashion."
I would like to offer you a bank account with 50% interest amortized over 500 years. I regret that you will not receive your first interest payment until the 500 years are up.
The point is that amortized performance gives you no control over when you're going to take the hit. That's OK if you only care about throughput.
i fully accept its need in some cases an indeed I've advocated 'regressing' an app at work, which was ported from C to Java, back into C again to use manual memory management for performance. But that app's an exception - sub-millisecond performance is required. How many day to day apps need that?
Every app that ever interacts with a user. It is never acceptable for an app to stop-the-world while it does something that I (as a user) do not care about. I get enough spinning beach balls as it is.
For people who don't have the background on this: Floyd Landis raced on Lance Armstrong's team while Lance was still racing. In one of Lance's books, he tells a great story about Floyd Landis -- I don't remember all the details, but it went something like this.
Floyd was training for the Tour with Lance's team, but not really pulling his weight. He was unmotivated, or not taking it seriously -- something like that (like I said, my memory is sketchy). Anyway, Lance pulled him aside and basically said "WTF?" He took Floyd to go training with him that day -- Lance had been training away from most of the team, doing high-altitude climbs, pushing himself harder than everyone else. He took Floyd with him and made him do the same climbs, and basically whipped him into shape, and after that Floyd became one of his team's most solid members.
I think it's pretty awesome that he went on to win the Tour.
(If anyone knows this story better than me, please fill in!)
This is a simplistic view of the world. It assumes that the only means of optimization is a big-O algorithm change. If you're using a bad algorithm and you're working with non-negligible data sets, then obviously you should choose a better algorithm -- that's just CS101. The interesting conversation doesn't even start until you are already using the best algorithm available to you.
Is C/C++ a panacea? Of course not -- straw man. But when your algorithms are equal, high-level languages will execute an algorithm many times slower than a low-level language. An asymptotic order slower? No. But those constant factors are significant.
The problem is that, because of some bad design decisions in C (the equivalence of arrays and pointers being the big one)
Arrays and pointers are not equivalent in C. And I think C is nearly perfect at being what it is: a portable assembler.
The basic problem of C is that you have to obsess on "who owns what" for memory allocation purposes, and the language gives you no help with this. The language doesn't even adequately address "how big is this". With those two design defects, we're doomed to have memory safety problems.
They're not design defects: you don't get these things in C because you don't get them from assembly either.
C is pretty much the only language that has no lies. Everything you do maps very directly to something that computers actually know how to do, like add, subtract, jump, load, store. Computers have ALUs, but alas, they don't have GCUs.
Perl and Python are reference-counted, and in practice, programmers in those languages seldom have to think about memory allocation issues.
Unfortunately reference-counting leaks in circularly linked structures.
Care to explain the difference? The "idiots" who wrote the Visual acuity article on Wikipedia are apparently under the same misunderstanding:
It is possible to have vision superior to 20/20: the maximum acuity of the human eye without visual aids (such as binoculars) is generally thought to be around 20/10 (6/3).
I heartily agree (at least for the moment) that the chief virtue of writing is clarity. And what has most inspired me to strive for clear writing is seeing good writing contrasted with bad writing.
For example, I genuinely enjoy reading The Economist Style Guide, just for fun, because it shows tons of examples where phrases we use every day are wordier than necessary. To me, the thrill of engineering is striving for the most elegant and powerful solutions to a problem. Demonstrating that writing has the same capacity for beautiful solutions (even to practical, and not artistic, problems) is all the motivation I need to write as best I can.
I would have loved the opportunity to do this while I was in college. Seize it while you can!
When you are a little kid, you have tons of time, but little skill, so you spend a lot of time being bored.
When you are an adult, you have a lot more skill and you're capable of doing great things, but so many things compete for your attention (job, house/apartment, car, family) that it's harder to chase big ideas. The people who do so become the abnormal people we call "startup founders."
College is this great crossover where you're just becoming good enough to do great things, but it's still normal to live in a totally non-domestic way. It's the time to chase big dreams.
Google is not only giving you lots of great ideas for interesting work and arranging for mentors to guide you through the learning process, but they're paying you to do it! Find a project that sounds up your alley, and do it!
My letter (I attempt to avoid grandstanding, because that sort of thing bounces right off an unreceptive listener):
Dr. Feder,
I understand that your charter is to protect the work of the artists you represent. However, I think it would benefit you to recognize cases where limited unauthorized use of their work actually benefits the artist, without losing any revenue or giving up any control, and enriches society as a whole.
As you are probably aware, Google frequently adapts its logo to commemorate people and events. Because Google is such a highly trafficked website, these tributes serve only to draw attention to the people or events being commemorated. Millions of people who have never heard of Joan Miro (such as myself) were exposed to an example of his style, and were given the opportunity to learn more about him. Google had nothing to gain financially from this, and you had everything to gain from the massive publicity.
Now my only impression of Joan Miro is that the rights to his works are controlled by an organization that contributes to the increasingly litigious nature of our country, by trying to control even reasonable, flattering, non-commercial uses of their artists' work.
Well, thanks for offering a window into the psyche of the moderators, who fail to realize that my joke is at least as funny as the one that kicked off this thread (and a lot more original).
Sigh... so much is lost on Slashdot moderators these days.
I understand that serious things can be joked about. For example, I don't have a problem with the prison rape joke in Office Space.
It's the context of this joke that I don't believe we as a society should tolerate (in a social, not legal sense). Here we have an object of public scorn (the Spam King -- I hate him too) who might go to prison, and we think it's funny that he might get raped once he gets there. We're not joking about a general concept, we're laughing about a terrible thing that is likely to happen to a real person.
Making jokes about Catholic priests and little boys is one thing. Grinning at a specific boy as he walks into a private meeting with a Catholic priest is another.
Unless you think that the people making these jokes are secretly *for* prison rape [...]
Did you think it was funny in "Shawshenk Redemption?"
Would you think it was funny if this Slashdot story was about Kevin Mitnick being in prison? Would that bring things a little closer to home?
It's depressing enough that the whole country knows this happens while we sit idly by. It's even worse that it's a "nudge nudge, wink wink" kind of joke.
I did a job about two years ago that involved programming to the QuickTime API. It was about the worst API I have ever had the displeasure of having to use. Unless they've added some nicer APIs in the last two years, I would never use QuickTime again if I had the choice.
Here is an excerpt of some of the gross code I was forced to write. I didn't just make this up -- it is almost exactly the same as the sample code from Apple, as well as other QuickTime code I came across. Notice all the weird casts everywhere, the handles that have multiple meanings, and the manual memory copy I am forced to do (to copy the contents of a handle into an "atom" -- WTF?) By the way, my use case wasn't super complicated -- all I wanted to do was read the contents of a sound file that is recognized by QuickTime.
// GetMediaSampleDescription takes a SampleDescriptionHandle, but apparently // if the media is a sound (which presumably we know it is) then it will treat // it as a SoundDescriptionHandle (which in addition to the format of single // samples, also tells you sample rate, number of channels, etc.) // Pretty messed up interface, if you ask me.
SoundDescriptionHandle soundDescription = (SoundDescriptionHandle)NewHandle(0);
GetMediaSampleDescription(mMedia, 1, (SampleDescriptionHandle)soundDescription);
// If this is a compressed format, it may have out-of-stream compression // parameters that need to be passed to the sound converter. We retrieve // these in the form of an audio atom. To do this, however we have to // get the data by way of a handle, then copy it manually from the handle to // the atom. These interfaces get worse all the time!
Handle decompressionParamsHandle = NewHandle(0);
AudioFormatAtomPtr decompressionParamsAtom = NULL;
err = GetSoundDescriptionExtension(soundDescription, &decompressionParamsHandle,
siDecompressionParams);
if(err == noErr)
{ // this stream has decompression parameters. copy from the handle to the atom.
int paramsSize = GetHandleSize(decompressionParamsHandle);
HLock(decompressionParamsHandle);
decompressionParamsAtom = (AudioFormatAtomPtr)NewPtr(paramsSize); //err = MemError();
BlockMoveData(*decompressionParamsHandle, decompressionParamsAtom, paramsSize);
HUnlock(decompressionParamsHandle);
}
Believe me, I've read that, and I understand that it's not a trust system. Unlike the gp poster, I understand the difference between authentication and authorization. gp claimed that "OpenID has no authentication or integrity checking," which is clearly false.
People like gp read something like "This is not a trust system" and take that to mean "this is a weak system, that you should not trust." They don't expend the mental energy to actually understand what that means, and instead go parroting around that "OpenID is very weak for an authentication system."
It's people like that who make it necessary to write press releases that dress up real technical content with fluff like "OpenID uses state-of-the-art SHA1 encryption technology to provide a bulletproof way to keep your identity safe."
Just because someone shows you a drivers license, you don't trust them with your house keys, do you?
Of course not. Who's proposing anything like that? But here's what it does mean. If I go to a doctor's office and show them my driver's license, they can establish an account for me there. They will associate my confidential medical records with that account. Later, I can access those records by presenting them my driver's license. The benefit is that I don't have to carry around *different* ID's for everything I do -- my driver's license authenticates me to everyone who stores information about me.
That is what OpenID can provide. And it's just as secure as any web authentication system out there (the security depends on the security of your "home" website, but if you are using it for sensitive things, you'll choose a home site whose security you trust).
Unfortunately, OpenID is very weak for an authentication system; it has no authentication or integrity checking.
What are you talking about? It's an authentication system! Of course it has authentication and "integrity checking."
Do you actually understand what its limits are?
(Hint: do you trust your bank's authorization scheme on their website? Your bank could authenticate you with third party sites using OpenID just as securely as they authenticate you with their own).
Just for future reference... "slippery slope" is not a valid argument. In fact, it is the name of a logical fallacy. When someone says "new legislation such and such could lead us down a very slippery slope", that's when you can stop listening because they have decisively abandoned logic.
You are relying on the assertion that passing "legislation such and such" does not create a political climate where similar legislation is more likely to pass. Without demonstrating this, you have no basis for calling the argument invalid. A slippery slope argument is not inherently a logical fallacy.
The people who wrote the slippery slope article on Wikipedia claim that "Use of the slippery slope can be valid or fallacious," and I agree with that characterization.
i used BeOS for a long time, on three platforms, and there's nothing i miss from it now.
There's one thing I miss terribly:
the fastest, most responsive GUI that has ever been built.
The only way any of today's GUIs come close is by running on hardware that is 10x as fast. And they still don't have the same responsiveness under load.
Now, there should be provisions for expiration of DRM concurrent with copyright and whatnot
Yeah, but there never will be. That's the problem of DRM.
DRM lets content producers legislate arbitrary terms. Copyright law becomes pretty much irrelevent, because the software dictates the terms, and DMCA gives those terms the force of law.
DRM completely eliminates the balance of Copyright law, because it gives content producers, who have an incentive to control every possible aspect of how their work is used, a blank check to do so.
If your programming immune system immediately rejects any language that is more mindbending than the simple if/while/for/switch/function constructs of C-like languages, you will forever be a pretty naive programmer.
As an example, JavaScript has OO, but no classes! How do you suppose that is? It's prototype-based OO. It's an interesting alternative to class-based OO. Well-rounded programmers can pick up a concept like that rapidly -- they don't just say "this is too much of a hassle."
The basics in Ruby are no harder than C or PHP. Things only get more difficult when you start saying things that simply cannot be said in C or PHP.
"Stop the world" garbage collection for this app usually takes less than 13ms.
"Usually" isn't good enough, not when "usually" just made you drop a video frame or overrun a sound buffer. Out of curiosity, though, what language is this? Experiences I have had with Java involved watching the GUI freeze when garbage collection happens. I would be happy to hear that GC wait times had indeed gotten this fast, though it's also likely that your fast GC is a result of your particular allocation patterns.
Modern GC is *faster* than hand-coded free calls in 90% of situations.
Greater throughput at the expense of latency. GC stops the world.
"A major reason for this is that the garbage collector allows the runtime system to amortize allocation and deallocation operations in a potentially advantageous fashion."
I would like to offer you a bank account with 50% interest amortized over 500 years. I regret that you will not receive your first interest payment until the 500 years are up.
The point is that amortized performance gives you no control over when you're going to take the hit. That's OK if you only care about throughput.
i fully accept its need in some cases an indeed I've advocated 'regressing' an app at work, which was ported from C to Java, back into C again to use manual memory management for performance. But that app's an exception - sub-millisecond performance is required. How many day to day apps need that?
Every app that ever interacts with a user. It is never acceptable for an app to stop-the-world while it does something that I (as a user) do not care about. I get enough spinning beach balls as it is.
For people who don't have the background on this: Floyd Landis raced on Lance Armstrong's team while Lance was still racing. In one of Lance's books, he tells a great story about Floyd Landis -- I don't remember all the details, but it went something like this.
Floyd was training for the Tour with Lance's team, but not really pulling his weight. He was unmotivated, or not taking it seriously -- something like that (like I said, my memory is sketchy). Anyway, Lance pulled him aside and basically said "WTF?" He took Floyd to go training with him that day -- Lance had been training away from most of the team, doing high-altitude climbs, pushing himself harder than everyone else. He took Floyd with him and made him do the same climbs, and basically whipped him into shape, and after that Floyd became one of his team's most solid members.
I think it's pretty awesome that he went on to win the Tour.
(If anyone knows this story better than me, please fill in!)
This is a simplistic view of the world. It assumes that the only means of optimization is a big-O algorithm change. If you're using a bad algorithm and you're working with non-negligible data sets, then obviously you should choose a better algorithm -- that's just CS101. The interesting conversation doesn't even start until you are already using the best algorithm available to you.
Is C/C++ a panacea? Of course not -- straw man. But when your algorithms are equal, high-level languages will execute an algorithm many times slower than a low-level language. An asymptotic order slower? No. But those constant factors are significant.
The problem is that, because of some bad design decisions in C (the equivalence of arrays and pointers being the big one)
Arrays and pointers are not equivalent in C. And I think C is nearly perfect at being what it is: a portable assembler.
The basic problem of C is that you have to obsess on "who owns what" for memory allocation purposes, and the language gives you no help with this. The language doesn't even adequately address "how big is this". With those two design defects, we're doomed to have memory safety problems.
They're not design defects: you don't get these things in C because you don't get them from assembly either.
C is pretty much the only language that has no lies. Everything you do maps very directly to something that computers actually know how to do, like add, subtract, jump, load, store. Computers have ALUs, but alas, they don't have GCUs.
Perl and Python are reference-counted, and in practice, programmers in those languages seldom have to think about memory allocation issues.
Unfortunately reference-counting leaks in circularly linked structures.
I heartily agree (at least for the moment) that the chief virtue of writing is clarity. And what has most inspired me to strive for clear writing is seeing good writing contrasted with bad writing.
For example, I genuinely enjoy reading The Economist Style Guide, just for fun, because it shows tons of examples where phrases we use every day are wordier than necessary. To me, the thrill of engineering is striving for the most elegant and powerful solutions to a problem. Demonstrating that writing has the same capacity for beautiful solutions (even to practical, and not artistic, problems) is all the motivation I need to write as best I can.
I would have loved the opportunity to do this while I was in college. Seize it while you can!
When you are a little kid, you have tons of time, but little skill, so you spend a lot of time being bored.
When you are an adult, you have a lot more skill and you're capable of doing great things, but so many things compete for your attention (job, house/apartment, car, family) that it's harder to chase big ideas. The people who do so become the abnormal people we call "startup founders."
College is this great crossover where you're just becoming good enough to do great things, but it's still normal to live in a totally non-domestic way. It's the time to chase big dreams.
Google is not only giving you lots of great ideas for interesting work and arranging for mentors to guide you through the learning process, but they're paying you to do it! Find a project that sounds up your alley, and do it!
My letter (I attempt to avoid grandstanding, because that sort of thing bounces right off an unreceptive listener):
Dr. Feder,
I understand that your charter is to protect the work of the artists you represent. However, I think it would benefit you to recognize cases where limited unauthorized use of their work actually benefits the artist, without losing any revenue or giving up any control, and enriches society as a whole.
As you are probably aware, Google frequently adapts its logo to commemorate people and events. Because Google is such a highly trafficked website, these tributes serve only to draw attention to the people or events being commemorated. Millions of people who have never heard of Joan Miro (such as myself) were exposed to an example of his style, and were given the opportunity to learn more about him. Google had nothing to gain financially from this, and you had everything to gain from the massive publicity.
Now my only impression of Joan Miro is that the rights to his works are controlled by an organization that contributes to the increasingly litigious nature of our country, by trying to control even reasonable, flattering, non-commercial uses of their artists' work.
Sincerely,
Well, thanks for offering a window into the psyche of the moderators, who fail to realize that my joke is at least as funny as the one that kicked off this thread (and a lot more original).
Sigh... so much is lost on Slashdot moderators these days.
Thanks, I appreciate it. I thought the "Troll" mod was pretty lame also, but what can you do?
I understand that serious things can be joked about. For example, I don't have a problem with the prison rape joke in Office Space.
It's the context of this joke that I don't believe we as a society should tolerate (in a social, not legal sense). Here we have an object of public scorn (the Spam King -- I hate him too) who might go to prison, and we think it's funny that he might get raped once he gets there. We're not joking about a general concept, we're laughing about a terrible thing that is likely to happen to a real person.
Making jokes about Catholic priests and little boys is one thing. Grinning at a specific boy as he walks into a private meeting with a Catholic priest is another.
Unless you think that the people making these jokes are secretly *for* prison rape [...]
Some of them are. They're not even secretive about it
Not everyone who is in prison did that.
Some of them might be there on a drug charge. Or a hacking charge.
Some of them aren't even guilty.
Why do people think it's OK to joke about this?
Did you think it was funny in "Shawshenk Redemption?"
Would you think it was funny if this Slashdot story was about Kevin Mitnick being in prison? Would that bring things a little closer to home?
It's depressing enough that the whole country knows this happens while we sit idly by. It's even worse that it's a "nudge nudge, wink wink" kind of joke.
Here is an excerpt of some of the gross code I was forced to write. I didn't just make this up -- it is almost exactly the same as the sample code from Apple, as well as other QuickTime code I came across. Notice all the weird casts everywhere, the handles that have multiple meanings, and the manual memory copy I am forced to do (to copy the contents of a handle into an "atom" -- WTF?) By the way, my use case wasn't super complicated -- all I wanted to do was read the contents of a sound file that is recognized by QuickTime.
Believe me, I've read that, and I understand that it's not a trust system. Unlike the gp poster, I understand the difference between authentication and authorization. gp claimed that "OpenID has no authentication or integrity checking," which is clearly false.
People like gp read something like "This is not a trust system" and take that to mean "this is a weak system, that you should not trust." They don't expend the mental energy to actually understand what that means, and instead go parroting around that "OpenID is very weak for an authentication system."
It's people like that who make it necessary to write press releases that dress up real technical content with fluff like "OpenID uses state-of-the-art SHA1 encryption technology to provide a bulletproof way to keep your identity safe."
Just because someone shows you a drivers license, you don't trust them with your house keys, do you?
Of course not. Who's proposing anything like that? But here's what it does mean. If I go to a doctor's office and show them my driver's license, they can establish an account for me there. They will associate my confidential medical records with that account. Later, I can access those records by presenting them my driver's license. The benefit is that I don't have to carry around *different* ID's for everything I do -- my driver's license authenticates me to everyone who stores information about me.
That is what OpenID can provide. And it's just as secure as any web authentication system out there (the security depends on the security of your "home" website, but if you are using it for sensitive things, you'll choose a home site whose security you trust).
Unfortunately, OpenID is very weak for an authentication system; it has no authentication or integrity checking.
What are you talking about? It's an authentication system! Of course it has authentication and "integrity checking."
Do you actually understand what its limits are?
(Hint: do you trust your bank's authorization scheme on their website? Your bank could authenticate you with third party sites using OpenID just as securely as they authenticate you with their own).
Just for future reference... "slippery slope" is not a valid argument. In fact, it is the name of a logical fallacy. When someone says "new legislation such and such could lead us down a very slippery slope", that's when you can stop listening because they have decisively abandoned logic.
You are relying on the assertion that passing "legislation such and such" does not create a political climate where similar legislation is more likely to pass. Without demonstrating this, you have no basis for calling the argument invalid. A slippery slope argument is not inherently a logical fallacy.
The people who wrote the slippery slope article on Wikipedia claim that "Use of the slippery slope can be valid or fallacious," and I agree with that characterization.
[Accusation that bash.org plagiarized kuro5hin.org first]
i used BeOS for a long time, on three platforms, and there's nothing i miss from it now.
There's one thing I miss terribly:
the fastest, most responsive GUI that has ever been built.
The only way any of today's GUIs come close is by running on hardware that is 10x as fast. And they still don't have the same responsiveness under load.
Now, there should be provisions for expiration of DRM concurrent with copyright and whatnot
Yeah, but there never will be. That's the problem of DRM.
DRM lets content producers legislate arbitrary terms. Copyright law becomes pretty much irrelevent, because the software dictates the terms, and DMCA gives those terms the force of law.
DRM completely eliminates the balance of Copyright law, because it gives content producers, who have an incentive to control every possible aspect of how their work is used, a blank check to do so.
If your programming immune system immediately rejects any language that is more mindbending than the simple if/while/for/switch/function constructs of C-like languages, you will forever be a pretty naive programmer.
As an example, JavaScript has OO, but no classes! How do you suppose that is? It's prototype-based OO. It's an interesting alternative to class-based OO. Well-rounded programmers can pick up a concept like that rapidly -- they don't just say "this is too much of a hassle."
The basics in Ruby are no harder than C or PHP. Things only get more difficult when you start saying things that simply cannot be said in C or PHP.
It was a front page headline in my local newspaper, and I don't even live in California. It's not just geek news.