Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Remain calm and confident in difficult times

by Anonymous Monk
on Nov 11, 2005 at 03:53 UTC ( [id://507620]=perlmeditation: print w/replies, xml ) Need Help??

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: Remain calm and confident in difficult times
by tilly (Archbishop) on Nov 11, 2005 at 07:18 UTC
    If you believe that I/O performance was the difference between Perl and Java on that test, then you believe that Perl's I/O system is so bad that it takes minutes to run through 100 MB of local data on a decent PC.

    No sane person with even a modicum of knowledge about the relative costs of different computing operations would think of that first. They wouldn't have to test it to know that I/O was highly unlikely to be the cause of that much slowdown.

    But you seem to think it worth testing, so I did a quick test on my laptop. Just running through and doing something trivial (counting lines) on a 5 MB file took me .266 seconds the firs time and 0.072 seconds on subsequent runs. Therefore the worst case just to run through 100 MB on my laptop would take under 6 seconds, and the vast majority of that worst case is spent with the operating system waiting for disk. (The difference between the first and later runs is that the file gets cached in RAM, so on later runs it doesn't go to disk.)

    Should you wish to repeat my test on your machine, here is the program:

    time perl -le '$l++ while <>; END {print $l}' BIG_FILE
    In short, as I predicted, file I/O for that much data is a couple of orders of magnitude too small to explain the performance difference in Tim Bray's test.

    As for your taking me to task for expecting Java to have not optimized this case, try compiling and running the following Java program:

    import java.util.regex.*; public class FooTest { public static void main(String[] args) throws Exception { Pattern p = Pattern.compile("^(\\s*foo\\s*)*$"); Matcher m = p.matcher("foo foo foo foo foo foo foo foo foo foo foo + foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo +foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo f +oo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo fo +o foo foo foo foo foo foo foo fo"); if (m.find()) System.out.println("Matched"); else System.out.println("Didn't match"); } }
    If that program hangs, then your version of Java does not implement the optimization that I said caused a significant slowdown in Perl. By my tests, Java does not implement that optimization, but perhaps you have a version that does. (I would bet money that you don't.)

    So while you disparage the reasoning by which I concluded that Java was very unlikely to have that optimization, I seem to have come to the correct conclusion about whether or not it did. If you wish, you may believe that I just made a lucky guess.

    Incidentally for future reference, if you're planning to criticize articles, it helps to provide links to them so that people can see what you're talking about. The article of mine that you were criticizing was Benchmarks aren't everything. I suspect that the other article was Enterprise Perl, but it might have been What is Enterprise Software? instead - I can't tell from what you've said.

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Remain calm and confident in difficult times
by Aristotle (Chancellor) on Nov 11, 2005 at 05:00 UTC

    I don’t see what the fuss is, anyway. Perl’s mainstream popularity may be waning, but how does that affect me? Java (which I truly find painful; but that is my preference and whether others agree is their business) is not the only option if I can’t write Perl for a living – there are other enjoyable languages. And even when I’m not writing Perl for a living, that doesn’t mean I don’t get to use Perl at all. And right now, I am being paid to write Perl, and I’m quite confident that I will find more people who would pay me to write Perl.

    Remember Perl’s mascot is a camel. It is not a peacock. Perl is quite comfortable doing the dirty work in the trenches. That’s how it got here at all and that’s why it’s still around. I don’t believe for a second those cries that it’s dying.

    Perl has a lot of history. There’s a lot of cruft in there. People are always after the “new” and shiny things; we in the IT industry are a huge flock of fashion-chasers. So it’s no wonder that the front and center attention is going elsewhere; but that doesn’t diminish the usefulness of Perl at all.

    (Sorry, I’m rambling. Hopefully you get the general idea of what I was trying to say.)

    Makeshifts last the longest.

      I fully understand what you have said, and agree to quite a few points you made here. I have absolutely no problem with intelligent discussion, which obviously involves different ideas, sometime even opposite ones. But one thing I for sure cannot stand is stupid thought (I don't comment those individuals, but those thought were stupid), those posts do nothing other than poisoning people's mind.

      The ability to do some serious research is certainly very important in order to post meditations, if we all want to maintain a high standard, but hey, this is a free world, you see all kinds of people.

Re: Remain calm and confident in difficult times
by tirwhan (Abbot) on Nov 11, 2005 at 07:12 UTC

    Troll. This is may be the fifth or sixth post I've read over the last few days containing exactly the same arguments and same stupid spelling mistakes. All of them posted anonymously, but it's pretty obvious they're from the same person (so you may as well have the common decency to log in and stand by what you're saying Mr.-collect-XP-by-day-Jekyll-troll-by-night-Hyde).

    Never mind that you completely misrepresent the facts. The first node you referenced is not about the relative performance of Perl and Java, but about the general tradeoffs between performance and correctness in programming (taking a performance comparison as example). The second post tries to find a definition for the term "enterprise software".

    And never forget, when people flame you it's possible that it's because you've said something stupid and nasty, rather than "an interesting psychological issue".


    Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -- Brian W. Kernighan
    A reply falls below the community's threshold of quality. You may see it by logging in.
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Remain calm and confident in difficult times
by johnnywang (Priest) on Nov 11, 2005 at 05:57 UTC
    Come on, please don't read too much into the posts. Most of us are here to learn something technical about perl. The meditation section is for such semi-serious amusements. I actually found tilly's post on regular expression quite informative perl-wise, and that's enough for an up-vote. I think every language has its passionate defenders/advocates, otherwise it probably will not survive. You will likley get the same reaction if you attack java in a java board, or python in a python board.

    As to feeling insecure, I think we all should be, with our indian friends and my fellow chinese working hard at a fraction of our rate, we're more in danger than our beloved languages.

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Remain calm and confident in difficult times
by tinita (Parson) on Nov 11, 2005 at 16:57 UTC
    my experience is more of the kind that java programmers i meet often rant about perl before i've said *one* word about java. they usually laugh about perl not being a real language because blah blah. my opinion about java is that i don't love it like perl but it's not bad at all. i just prefer perl whenever i can because i like it, because development time is shorter and because performance is better (in my experience, that is!).

    so my question would be why are a lot of java programmers agressive like that?

    often the same people continuously try to convince me to use eclipse and make jokes about vim. can't they just shut up? i don't bug them with vim either if i'm not asked.

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Remain calm and confident in difficult times
by Anonymous Monk on Nov 14, 2005 at 07:15 UTC
    Lessons From a Master Troll

    Anonytroll isn't in the same class as Dr. Flonkenstein, but if he keeps refining his technique, he could eventually be pretty good. Important to realize that all those spelling mistakes don't necessarily mean he can't spell. For a troll this kind of stylistic marker may also serve to warn other trolls away, or at any rate that he is "top troll" in this environment -- like bears rubbing their smell on a tree, that sort of thing.

    ++ for "I am not going to feed this obvious troll." -- for going after tilly instead of fanning the flames in some other direction. After that thoughtful post tilly didn't deserve it.

    That said... don't feed the trolls!

Re: Remain calm and confident in difficult times
by Elgon (Curate) on Nov 11, 2005 at 15:34 UTC
    Why do you never actually include any code in your nodes?

    Elgon

    It is better either to be silent, or to say things of more value than silence. Sooner throw a pearl at hazard than an idle or useless word; and do not say a little in many words, but a great deal in a few.

    Pythagoras (582 BC - 507 BC)

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Remain calm and confident in difficult times
by tphyahoo (Vicar) on Nov 14, 2005 at 07:09 UTC
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://507620]
Approved by johnnywang
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-03-29 13:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found