202 points · by orrsella · 13y ago · 126 comments
Tons of anecdotal stories with no evidence. Obvious outsiders trying to image what it is like on the inside (all the guesses about how DDG works) and of course no facts to back anything up.
I would say this pandering and uninformed behaviour is not common on HN, but it is.
People who engage in language flame wars simply do not understand that when you become a good programmer languages do not matter only the platforms matter.
I'd hardly call the argument over language speed a 'flame war' by any internet standard I've ever seen.
There are probably better examples than this one to pull the 'HN commenters suck' card. The conversation here is mostly civil and trying to learn things, one troll aside.
But that said, choosing anything interpreted does come to haunt you later on, in some way or the other.
We run Java on Jettys for most of the things for our app (traffic is around 60k/70k in a day, so much less in comparison). But even with this traffic, we need to use 2 large EC2 instances in the day time. And mysteriously the Jettys keep going out of memory every now and then.*
I am sure the same thing if done in C++ would need only 1 large EC2 instance. And it will also help the latency a bit, as a parallel gain. At present am analyzing the cost/benefit of such a move. Inputs are welcome.
* With Java its always the memory which hurts you first. Latency wise, not much of a difference, in most cases.
Edit: Down vote? Surprised. Why??
Guess you're building the next killer app in brainfuck?
Also, doesn't it seem inefficient to have crawlers here and indexes there?
I guess its time to stop worrying about performance of your programming language & start building better high-salable architectures.
[1] Slowest of all languages http://benchmarksgame.alioth.debian.org/u32/which-programs-a...
Later, I did similar, non-trivial benchmarks with Python and Ruby, and found a similar, 2x factor. Ruby has improved since then, but unless Perl has become dramatically slower in the same interval, I suspect that these benchmarks are either trivial (i.e. simple loops), or badly written.
Please - less FUD and more looking at program source code (which is 2 clicks from the URL you were given).
A quick inspection of the tests suggests a high enough bogon count that it already begins to confirm my suspicions: there's a "fasta-redux" test for Perl which dramatically outperforms the "fasta" test that's implemented cross-language. Also, many of these tests are written in least-common-denominator style, which doesn't reflect the way the languages are actually used.
http://benchmarksgame.alioth.debian.org/u32/benchmark.php?te...
So i have to say i am quite suspicious of the chart on the page you linked.
For eg: Here is Which programs are best with those benchmarks removed: http://benchmarksgame.alioth.debian.org/u32/which-programs-a...
This shows Perl higher up the chart with it being 49% better (on average) than Ruby.
Some other things to note:
1. Perl has never been fast with binary trees. But Ruby 1.8 is even worse (I recall it being many times slower than Perl at this). So hats off to the Ruby 1.9 VM guys because they've turned things around and now it's even out pacing Lua on this benchmark! - http://benchmarksgame.alioth.debian.org/u32/performance.php?...
2. Fasta in Ruby maybe twice quicker than Perl however it uses over 100 times more memory! This is be because it's inlining some code (eval) giving it a huge speed bump at expense of a bigger program footprint. If I do a port of this to Perl then this fasta.pl runs 2.6 times faster than alioth's perl version (which now means the Ruby version is about 30% slower than it's direct equivalent Perl version).
3. My make_repeat_fasta idiomatic subroutine is actually a little slower than the one in fasta.pl on alioth. So both my fasta.pl & alioth's fasta.rb programs could be speeded up more :)
4. I may even be able to shave a little bit more off fasta.pl time. Same might be true for spectral norm & binary-tree however the Perl versions aren't showing up on alioth site at moment :( ... IIRC, when I last looked at the perl binary-trees code on alioth a couple of years ago I was able to shave 10% off.
ref: My perl port of fasta.rb on alioth - https://gist.github.com/4675254
What if we are selective with the evidence a different way, what if we take away k-nucleotide and pi-digits and reverse-complement :-)
>> My perl port of fasta.rb <<
http://benchmarksgame.alioth.debian.org/u32/which-programs-a...
That is precisely why i am suspicious. I cannot say for a fact that it is deceptive, but it certainly seems deceptive.
On that page Ruby is being shown as 10% faster than Perl. Yet on the direct comparison page things look quite different:
http://benchmarksgame.alioth.debian.org/u32/benchmark.php?te...
On that page, for all benchmarks that can be compared, Perl has used an overall time of 9255 seconds, while Ruby has used an overall time of 10662 seconds. As such Ruby is actually 10% slower than Perl.
Where does this difference come from?
EDIT: I mean, it ~150 doesn't seem that much, but I'm sure the requests are not uniformly distributed, so the system should be able to handle much more than that within reasonable latency bounds.
Writing an internet scale search engine on the other hand would require different tools. Most successful projects has probably been done i C, C++ and maybe Java.
One useful metric change is to add "memory (usage)" weight - http://benchmarksgame.alioth.debian.org/u32/which-programs-a...
Based on this we should all be using Pascal ;-)
edit: fix the name
It's not the language that makes handling big data slow. It's the algorithms and how you move the bits around.
Also an anecdotal example. Two months ago a friend of mine wrote a rather complex algorithm in Perl (He is very fluent with it). It was a novel sentence alignment algorithm using Gibbs sampling. Algorithm was hard to make parallel and not cache friendly. He needed to wait more than a day for training the system in a server. Well, long story short, with his help another developer converted it to Java in short time it worked around 200 times faster. So there. Moving bits around did not help Perl here at all.
I wrote the first prototype of Boitho (Norwegian internet search engine, now defunct) in Perl in 2000. That did not work at all because memory access and sorting was so slow. We had to write the next version in C. Of course a lot has happen with Perl in the last 13 years, but search kernel in Perl still sounds odd in my ears.
But regardless of that Perl continues to power some very serious work happening some very important places all over the world. And that is not likely to change sooner. No matter how many web frameworks get written in Php, Ruby or Python.
The reason for that is Perl has little or almost no competition in the niche it occupies. And anything that is likely to be invented to replace Perl will by and large like 99% look like Perl(Read: Perl 6 or whatever). This being the case we are likely to be using Perl(or a Perl like language) very far into the future.
That said I think the competition DDG has provided the other search providers has been a benefit to me.
Frankly, I think this is morally wrong. When they use an inferior search engine, or inferior maps app for that matter, people are dumber than they might otherwise be. They miss a boost of intelligence, perhaps not IQ, but they are less effective operating in the real world. The world as a whole is worse because of it.
However, you're saying that the only thing (or the best thing) that will make the world better is better quality results. This is wrong. Playing the long game by supporting such search engines means that quality can improve and you end up with both better quality search engines AND morally improved companies. The whole world will be better because of it. You're thinking too short term.
> We also do about 12M API requests per day: http://duckduckgo.com/traffic.html
So they are using node? I can't think of YUI being "low level javascript" at all.
By your admission, you don't have any experience with search engines, and yet you have definitive opinion about everything related to it.
I understand why people values DuckDuckGo for privacy reasons. I respect that. But sure devleoping it, is far far easier than developing a real search engine.