Java is slower than C++!

L

Lew

Luc The Perverse skrev:
Go, Weiqi, Baduk - the best board game ever invented.

You cannot gain respect in Asia ignorant of this game, in the way you cannot
gain respect in America ignorant of golf.

You need to improve your Google-fu - it is not hard to add qualifying words to
your search, as in "Go board game".

But to recap Lars Enderin's comment about searching just on "Go":
that link was the second major hit.
 
L

Luc The Perverse

Lew said:
Luc The Perverse skrev:

Go, Weiqi, Baduk - the best board game ever invented.

You cannot gain respect in Asia ignorant of this game, in the way you
cannot gain respect in America ignorant of golf.

You need to improve your Google-fu - it is not hard to add qualifying
words to your search, as in "Go board game".

But to recap Lars Enderin's comment about searching just on "Go":

that link was the second major hit.

Thanks guys!

I will try google next time.
 
T

Twisted

Luc The Perverse skrev:


Go, Weiqi, Baduk - the best board game ever invented.

You cannot gain respect in Asia ignorant of this game, in the way you cannot
gain respect in America ignorant of golf.

*sputter* You can too. In intellectual circles, you can't gain respect
in Asia ignorant of Go, or in America ignorant of chess, perhaps. But
golf?!
You need to improve your Google-fu - it is not hard to add qualifying words to
your search, as in "Go board game".

Given that the person in question didn't know I was referring to Go-
the-board-game, why exactly would it have ever occurred to him to use
"board game" in his search query? :)

I'm afraid I must find for the question-asker here: given that he was
unfamiliar with that usage of the word "Go" (arguably surprising, but
not an indictable offense), and given that there were no real hints at
qualifying terms to add to the query (chess being mentioned could
suggest "board game", but code optimization being mentioned could
suggest "compiler" or even, ObTopic, "java", instead), and given that
Google queries of short, common English words without qualifying terms
will tend to be a crapshoot at best (specific known exceptions
notwithstanding), I'd say he did the right thing in asking me to
clarify what I meant.

And if I'd gotten to it before anyone else had done so I'd have
answered him, honestly and unsnarkily.
that link was the second major hit.

And who would have guessed that, without prior knowledge? Not the
question-asker and not I.
 
L

Lars Enderin

Twisted skrev:
*sputter* You can too. In intellectual circles, you can't gain respect
in Asia ignorant of Go, or in America ignorant of chess, perhaps. But
golf?!


Given that the person in question didn't know I was referring to Go-
the-board-game, why exactly would it have ever occurred to him to use
"board game" in his search query? :)

I'm afraid I must find for the question-asker here: given that he was
unfamiliar with that usage of the word "Go" (arguably surprising, but
not an indictable offense), and given that there were no real hints at
qualifying terms to add to the query (chess being mentioned could
suggest "board game", but code optimization being mentioned could
suggest "compiler" or even, ObTopic, "java", instead), and given that
Google queries of short, common English words without qualifying terms
will tend to be a crapshoot at best (specific known exceptions
notwithstanding), I'd say he did the right thing in asking me to
clarify what I meant.

And if I'd gotten to it before anyone else had done so I'd have
answered him, honestly and unsnarkily.


And who would have guessed that, without prior knowledge? Not the
question-asker and not I.
I made a mistake in my comment. I think you were the one who thought it
ridiculous to even try to google for "Ant", and it was in this very
newsgroup (comp.lang.java.programmer).
 
K

Karl Uppiano

I made a mistake in my comment. I think you were the one who thought it
ridiculous to even try to google for "Ant", and it was in this very
newsgroup (comp.lang.java.programmer).

I think the rule should be, Google first, then ask. I am seldom disappointed
with Google results, even for obscure references.
 
T

Twisted

I think the rule should be, Google first, then ask. I am seldom disappointed
with Google results, even for obscure references.

Obscure references aren't the problem, if they are just plain obscure,
but fairly specific. For those, there's nothing better than Google --
there's a reason "Who Wants to Be a Millionaire?" never had a "search
Google" lifeline. ;)

*Ambiguous* references are the problem, especially when there's a) a
very common meaning and b) a very obscure one and you're fairly
certain the latter is meant. The expectation is that common meaning
usages will dominate the search results, and worse, even if various
different meanings or usages are apparent from the results, it still
may not be clear which of these is the one. On occasion, there are
exceptions, but obviously they can't be counted on.

If you know "ant" is Java-related, a search for "ant" may well turn up
a reference to the Java-related one as well as the bug, and you can
recognize the relevant usage from the two. That apparently does occur,
but it's the exception to the rule, not the rule. Moreover, the same
thing that lets you tell which "ant" results are the "right" results
also lets you use a better query to begin with, e.g. "ant java".

If you know very little about "Go", other than that someone didn't
apparently mean the usual thing by it, a bunch of Google results some
of which refer to travel, some to the board game, and some to who
knows what else won't elucidate matters any. In this case, it may be
the case that "computer go" would give a useful result set focused
around the game; then again it might not, since "go" is such a common
word. (An actual test produces mostly references to game software and
AI, but there are some unrelated results mixed in as well, in the
first ten hits.) Some browsing might reveal that the game software and
AI problem are connected, and suggest that it fits in with the
computer chess I mentioned, but who has time for that much random link-
chasing with precious little indication of what was meant? I for one
am not bothered if I say something like I did and someone asks me for
clarification! It takes me less time to provide it, civilly at that,
than it would probably take them to do a bunch of searches, follow
some links, and guess, and they end up with a truly certain answer
besides, since it comes from the horse's mouth. Much more efficient
use of man-hours.

And of course there's the cases, the vast majority, where it's
completely useless. Consider "woody":

Woody Allen - Wikipedia, the free encyclopedia

Woody - Wikipedia, the free encyclopedia
Sheriff Woody, a character in the Toy Story movies; ...

Welcome to the Official Woody Guthrie Website

Official Woody Guthrie web site

Debian GNU/Linux 3.0 "woody" Release Information

WOODY'S TORONTO

Woody Woodpecker DVD

Woody's Office Portal - wopr.com

Woody Harrelson

Woody's Tavern - Ft. Worth, TX

There's a ton of "woody" hits. In the top ten hits, reprinted above,
are nine different meanings: three different celebrities, two
different fictional characters from animated films, two different bar-
type venues in separate cities (and most of the 6.5 billion potential
searchers are nowhere near either and nowhere near rich enough to
travel to either on a whim, besides), one office-supplies company (or
something; with a cute War Games reference -- how did they, of all
people, manage to snag THAT domain name? Arrrgh! I wanted it), and one
piece of software.

If it had come up in a computer discussion, without elaboration, good
luck. The Debian distro would probably be the correct reference (and
it's the one I was thinking of when I picked it for my test case).
It's lucky that Debian Woody is even in the top ten results, given the
numerous less obscure meanings of this common English word. The office
supplies hit is another candidate, since computers are among the
commonest of office tools; if "woody" came up in a discussion around
the water cooler or on the internal Usenet server at the office, it
would be a strong candidate indeed. And given the penchant people have
for slipping pop culture references in all kinds of places however
irrelevant they may be there, you'd not be able to discount the
celebrities and fictional characters entirely. That means you'd
eliminate the tavern and the club and leave 8 possible hits, with 7
different meanings.

Not looking good.

I rest my case.

(Interesting that the slang meaning of "woody" that is R-rated doesn't
crop up. Is Google biasing its results for common terms against
pornographic results, and perhaps in favor of tech-related results?)
 
K

Karl Uppiano

Twisted said:
Obscure references aren't the problem, if they are just plain obscure,
but fairly specific. For those, there's nothing better than Google --
there's a reason "Who Wants to Be a Millionaire?" never had a "search
Google" lifeline. ;)

*Ambiguous* references are the problem, especially when there's a) a
very common meaning and b) a very obscure one and you're fairly
certain the latter is meant. The expectation is that common meaning
usages will dominate the search results, and worse, even if various
different meanings or usages are apparent from the results, it still
may not be clear which of these is the one. On occasion, there are
exceptions, but obviously they can't be counted on.

If you know "ant" is Java-related, a search for "ant" may well turn up
a reference to the Java-related one as well as the bug, and you can
recognize the relevant usage from the two. That apparently does occur,
but it's the exception to the rule, not the rule. Moreover, the same
thing that lets you tell which "ant" results are the "right" results
also lets you use a better query to begin with, e.g. "ant java".

If you know very little about "Go", other than that someone didn't
apparently mean the usual thing by it, a bunch of Google results some
of which refer to travel, some to the board game, and some to who
knows what else won't elucidate matters any. In this case, it may be
the case that "computer go" would give a useful result set focused
around the game; then again it might not, since "go" is such a common
word. (An actual test produces mostly references to game software and
AI, but there are some unrelated results mixed in as well, in the
first ten hits.) Some browsing might reveal that the game software and
AI problem are connected, and suggest that it fits in with the
computer chess I mentioned, but who has time for that much random link-
chasing with precious little indication of what was meant? I for one
am not bothered if I say something like I did and someone asks me for
clarification! It takes me less time to provide it, civilly at that,
than it would probably take them to do a bunch of searches, follow
some links, and guess, and they end up with a truly certain answer
besides, since it comes from the horse's mouth. Much more efficient
use of man-hours.

And of course there's the cases, the vast majority, where it's
completely useless. Consider "woody":

Woody Allen - Wikipedia, the free encyclopedia

Woody - Wikipedia, the free encyclopedia
Sheriff Woody, a character in the Toy Story movies; ...

Welcome to the Official Woody Guthrie Website

Official Woody Guthrie web site

Debian GNU/Linux 3.0 "woody" Release Information

WOODY'S TORONTO

Woody Woodpecker DVD

Woody's Office Portal - wopr.com

Woody Harrelson

Woody's Tavern - Ft. Worth, TX

There's a ton of "woody" hits. In the top ten hits, reprinted above,
are nine different meanings: three different celebrities, two
different fictional characters from animated films, two different bar-
type venues in separate cities (and most of the 6.5 billion potential
searchers are nowhere near either and nowhere near rich enough to
travel to either on a whim, besides), one office-supplies company (or
something; with a cute War Games reference -- how did they, of all
people, manage to snag THAT domain name? Arrrgh! I wanted it), and one
piece of software.

If it had come up in a computer discussion, without elaboration, good
luck. The Debian distro would probably be the correct reference (and
it's the one I was thinking of when I picked it for my test case).
It's lucky that Debian Woody is even in the top ten results, given the
numerous less obscure meanings of this common English word. The office
supplies hit is another candidate, since computers are among the
commonest of office tools; if "woody" came up in a discussion around
the water cooler or on the internal Usenet server at the office, it
would be a strong candidate indeed. And given the penchant people have
for slipping pop culture references in all kinds of places however
irrelevant they may be there, you'd not be able to discount the
celebrities and fictional characters entirely. That means you'd
eliminate the tavern and the club and leave 8 possible hits, with 7
different meanings.

Not looking good.

I rest my case.

(Interesting that the slang meaning of "woody" that is R-rated doesn't
crop up. Is Google biasing its results for common terms against
pornographic results, and perhaps in favor of tech-related results?)

Yeah, I get all that, and I have had some frustration when searching for
specific things, but far more often than not, Google does turn up results
that answer my question. At worst, it gives me a bunch of interesting links,
if I'm looking for some entertaining reading! :)
 
L

Lew

And yet one quick post to the group disambiguated all those to the second
major hit on the board.

Yes, the "Go" reference was a tad too hip for the room, perhaps, but it's a
well-known game, particularly among engineers, so the introduction of the
reference was not such a shot in the dark in context.
 
L

Luc The Perverse

Karl Uppiano said:
Yeah, I get all that, and I have had some frustration when searching for
specific things, but far more often than not, Google does turn up results
that answer my question. At worst, it gives me a bunch of interesting
links, if I'm looking for some entertaining reading! :)

In my defense, I did not know Go was a board game. If I'd known it were a
game I'd have likely tried google - I thought it was some obscure joke.
 
T

Twisted

In my defense, I did not know Go was a board game. If I'd known it were a
game I'd have likely tried google - I thought it was some obscure joke.

Not that you should need a defense. Asking a question when you don't
know something isn't criminal. Although perhaps *not* asking one
should be.
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Twisted said:
Yup. Computers can now routinely beat the best humans at chess and
code-optimization, and they're even getting somewhere with Go now.

Obvious not since the humans could and should start by
looking at the compiler generated code.

Arne
 
S

Stefan Ram

Arne Vajhøj said:
Since an assembler programmer could and should start by looking
at compiler generated code,

An assembler programmer does not do this on a regular base,
just like a Java programmer does not code a GUI by looking at
code generated from a GUI-builder (unless he has not got a clue).
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Stefan said:
An assembler programmer does not do this on a regular base,
just like a Java programmer does not code a GUI by looking at
code generated from a GUI-builder (unless he has not got a clue).

If the reason for using assembler is to make it run faster
than compiler generated code - sure he will.

Arne
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Arne said:
If the reason for using assembler is to make it run faster
than compiler generated code - sure he will.

Your GUI example is equivalent to looking at the generated
code to get something that will assemble.

The equivalent GUI example of what I am talking about is to
study other GUI's that people like to see what works and what
does not work for GUI's.

Arne
 
S

Stefan Ram

Arne Vajhøj said:
If the reason for using assembler is to make it run faster
than compiler generated code - sure he will.

Usually, manually crafted assembler /will/ be faster, even if
the assembler programmer did not take a look at the compiler
generated code before. Just by coding reasonable and knowing
the machine.

At least, it used to be this way.

The whole point of Roedy was, that with Jet, the programmer
now would need to read the Jet code indeed, in order to write
faster code.

But this is something new. It did not used to be this way.
 
M

Martin Gregorie

Stefan said:
Usually, manually crafted assembler /will/ be faster, even if
the assembler programmer did not take a look at the compiler
generated code before. Just by coding reasonable and knowing
the machine.

At least, it used to be this way.
>
Back in the early '80s I wrote a lot of 6809 assembler before getting a
PL/9 compiler. For the older hands, PL/9 was similar to PL/M. The PL/9
compiler was an integrated editor, compiler and source level debugger
that ran in 32Kb of RAM, but I digress.....

The code it generated per statement was well optimized and was almost
impossible to beat for size and speed. With care you could sometimes
beat it by rewriting complete functions in assembler but usually the
best you could do was to eliminate instructions that saved registers at
the end of one statement and reloaded them at the start of the following
statement.

IOW the hand optimization did little more than the keyhole optimizer
that formed part of older C compilers - and PL/9 never claimed to be an
optimizing compiler.
 
R

Roedy Green

Since an assembler programmer could and should start by looking
at compiler generated code, then that sentence does not make
much sense.

I suggest you go look at some of the Jet generated code and you will
see why that is not feasible. The code becomes too fragile to
maintain, and VERY complex.

For example a loop may be implemented as several variations on the
same code with switching at the start to decide which one to use.
You have not the patience for that degree of repetition in hand-coded
assembler.
 
R

Roedy Green

IOW the hand optimization did little more than the keyhole optimizer
that formed part of older C compilers - and PL/9 never claimed to be an
optimizing compiler.
I have written lots of "perfect" X86 assembler code. By this I mean
code sequences were fed to Michael Abrash's try ALL possibilities to
get the same effect optimiser. I learned all kinds of X86 specific
tricks.

X86 was designed for hand assembly. All works great if you put things
in just the right magic registers. It is extremely non-orthogonal
which must make life difficult for the automated optimisers.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,201
Latest member
KourtneyBe

Latest Threads

Top