Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^6: threading a perl script

by vkon (Curate)
on Apr 24, 2011 at 17:42 UTC ( [id://901070]=note: print w/replies, xml ) Need Help??


in reply to Re^5: threading a perl script
in thread threading a perl script

I agree that by using threads more often perl threads will get better.
Maybe I will use threads more often - but right now there is no pushing need for me on that, and also I still have an impression that I am paying too much a price for threads - (10% slowdown for running ordinary scripts and increased complexity of scripts)

I know nothing about DNA processing and so could be unaware of some hidden quirks on that. You know better.

but yor example do not convince me much.
Obviously - your 'fuzzy' sub will be much faster in C (or in XS), but even better than that - there are fuzzy string matchers C libraries, that should work better.

you're reinventing something in pure-perl, while there are number of possibilities:

  • TRE, POSIX-compliant regexp engine that allows fuzzy matches, and has wrapper around it
  • http://search.cpan.org/~jgoldberg/Text-LevenshteinXS-0.03/LevenshteinXS.pm
  • http://search.cpan.org/~jhi/String-Approx-3.26/Approx.pm
  • etc
all these are fast and (hopefully) well-tested.

But - left aside your current implementation of some fuzzy matches - I have a conclusion, that - maybe you could create an example where perl program could benefit from being threaded.

For me, this is not so - in my real life - non-threaded perl is better - because it is faster - and I, personally, never benefit from threads in perl.

Having said that,
I will remain your friend with non-threaded perl
:) :)

Replies are listed 'Best First'.
Re^7: threading a perl script
by BrowserUk (Patriarch) on Apr 24, 2011 at 18:56 UTC
    ... all these are fast and (hopefully) well-tested.

    No. They are not. They measure the wrong thing and are dog slow. Trust me on this, because I have tried them and measured.

    And that is the problem. You--like many others--make definitive statements based upon assumptions rather than tests.

    I, personally, never benefit from threads in perl.

    Of course you don't. You never use them. How could you?

    I will remain your friend with non-threaded perl

    Great! I really hope that is so. Please don't take what follows personally.

    What I do object to is you--and others--who are variously too scared, too lazy, or threads-are-too-MS, or simply too disinterested, to be bothered to actually try them, and work out what they are good for and what they are not, popping up in any discussion the mentions threads, saying they are useless, broken and will cause your grandchildren to be born with multiple heads.

    And all based on something you half-read and totally misunderstood, written by somebody who misheard it from someone they met at a tech conference--or maybe they read it on the back of a cereal packet.

    If you don't use them, that's fine. If you can demonstrate alternative solutions that are simpler, quicker, more portable, or more X, please do. Really, please do. I like nothing better than a good head-to-head comparison. But if all you have to 'contribute' to these threads is general, non-specific negativity, it really wears thin fast.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

        Yes. And??

      all true.
      except for this
               And all based on something you half-read and totally misunderstood, written by somebody who misheard it from someone they met a tech conference--or meybe read it on the back of a cereal packet.
      my opinion was based on RTFS and reading p5p and reading ./win32/Makefile

                They measure the wrong thing and are dog slow.
      again, you know better, given that you attacked a problem thoughtfully.

      ok, you convinced me :)
      I will have more careful approach about threads, and will stop explaining to each other about drawbacks of perl threads.

      Have a nice day,
      Vadim.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2024-04-23 14:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found