- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
A whole bag, or a single kernel?
Admin
Hey, those are my lottery numbers...
Admin
That sounds plausible enough to me... and I'm guessing they run often do full test run around mid-morning and mid-afternoon...
Admin
My computer did not appear to be very busy while the test was running. In fact it was suspiciously non-busy for a machine running unit tests. CPUs were idle, disk was idle too.
In the end the reason turned out to be, that previously while debugging a race condition, I had put a sleep statement in the code, and forgotten to remove it again when I was done debugging.
Admin
"Knock knock" "Who's there?" [an hour later] . . . . . Java
Even if the moderators were confused by another Norman Diamond posting something in the middle of that sequence, I wonder what they found objectionable about this joke. I guess I'd better start posting advertisements for stolen credit cards instead.
Anyway, I don't know why the orphaned :rimshot: remained. You can go back to sleep now.
Admin
Java, the language, or Java, the implementation?
It makes no sense to speak of a language as though it has speed, for each language may have multiple implementations and, in this particular case, there are a huge range of implementations that differ quite drastically in speed. Let us analyse that range.
In 1995, Sun Microsystems released the Java 1.0 VM. It was originally a source-code interpreter, and it probably ran on a Pentium Pro, at best.
At somewhere around 1997-1998, the Java 1.1 VM was released. It compiled source code to byte-code, and used a byte-code interpreter instead. The resulting speed benefits were of course, quite significant, not to mention that the VM was probably running on Pentium IIs.
Is the Java 1.1 VM, running on a Pentium II, faster than the Java 1.0 VM, running on a Pentium Pro? Sure is. Does that make it "fast"? Perhaps not as fast as C++, right? Is the Java 1.1 VM, running on a Pentium II, faster than code produced by C++, running on a Pentium Pro?
These days, there are multiple implementations for C++, too. They range from source-code interpreters (with speeds comparable to the first JVM) and byte-code compilers (some of which may target JVM bytecode) to fully-fledged AOT compilers (those that we all know and love). It makes no sense to call C++ "fast", because there are slow implementations and fast implementations.
Conclusion: Don't make judgements about the speed of a language. Make judgements about the speed of an implementation.
An implementation is a program that performs an actual task. If you're not profiling it, you can't give meaningful measurements about its speed. Usually this would be a response to your boss asking you to optimise a program for production.
This includes the computer in its scope. If the production system differs in hardware specification to the testing system, then you have a potential problem. You can't be certain that you're optimising for one hardware configuration by optimising for another.
The compiler you use is also included in the scope. If one compiler produces better results than another, then your profiling should identify this, and it might be a good idea to use the compiler that produces more optimal code.
When you profile your code, you'll recognise that it shows you the modules/functions that are most used and occupy the most time, etc. These are statistics you can use to help decide where optimisation is most feasible.
Different compilers may cause different statistics, as may different OSes and different hardware configurations. Hence, if you're going to talk about the speed of an implementation, it'd be a good idea to specify the entire implementation, which includes details of the hardware, OS, compiler and program (eg. by source code)... and that's precisely what reputable benchmark websites (eg. alioth) do.
Otherwise, I have the very right to define Java as "Java 1.0, running on a Pentium Pro" and C++ as "C++ gcc 4.8.0 running on the latest Xeon with 16 cores and 16GB of RAM, automatic loop parallelism enabled"... Of course Java will be slow, in this example... but what if you swap them around, and run the C++ on the Pentium Pro and the Java on the modern-day Xeon?
It's worth noting, since someone made a big deal about repainting and resizing, that when Windows decides that your program isn't responding, it suspends repaints and draws a blank canvas instead. This has been the case since Windows XP, IIRC. Prior to that, instead of drawing a blank canvas they would draw whatever was visible prior to the repainting. That commonly included the desktop, another program, the start menu, overlapping frames of a dialog or the mouse being dragged around the screen, etc. Java's not the only victim.
Image verification: suscipere. People who associate speed to programming languages, or don't specify implementation details when associating speed to implementations, are being quite suscipere. Thanks, Latin :)
Admin
I believe that testQuartz's reply was there before your comments were deleted.
Admin
I don't know who the other Norman Diamond is who posted in the middle of the deleted sequence, but that doesn't matter. When I lived in Toronto I was one of two Norman Diamonds in the phone book. When I worked in Guelph there was a Norman Diamond in the Guelph section of the phone book, but I was in the Kitchener-Waterloo section of the same phone book. One time I shared a table with someone named Larry Diamond so people assumed I was his brother, but his brother Norman was someone I've never met.
I'm not the only one with a shared name. There are two people named Kathryn Keneally. One is an assistant attorney general in the US Justice Department's Tax Division and was quoted in a CNBC article warning about the danger of stolen identity refund fraud. The other is an assistant attorney general in the US Justice Department's Tax Division who opposes victims in court when victims of stolen identity refund fraud sue to try to get their refunds. I wonder if the two of them could meet and have a fruitful discussion, or if they'd annihilate each other like matter and antimatter.
Admin
You could just register and remove all doubt.