Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^13: Amicable divorce

by LanX (Saint)
on Jul 24, 2020 at 16:00 UTC ( [id://11119767]=note: print w/replies, xml ) Need Help??


in reply to Re^12: Amicable divorce
in thread Amicable divorce

> Perl 5.8 threads was a compromise where everything is cloned so that there is no interference between threads and whenever you want to share something, you have to say it explicitly and an intermediate (and quite inefficient) layer that does the locking and serializes access is set up by the runtime.

I'm by far no expert here, but I remember seeing benchmarks where the Perl approach actually did beat Python's GIL in terms of performance.

But benchmarks are like statistics, the author often only measures his own prejudices ... ;-)

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^14: Amicable divorce
by salva (Canon) on Jul 24, 2020 at 21:35 UTC
    I'm by far no expert here, but I remember seeing benchmarks where the Perl approach actually did beat Python's GIL in terms of performance.

    Different trade-offs: Python thread creation is cheap, but then they don't run in parallel except when performing I/O operations. Data is shared and there is no overhead for using threads.

    Perl on the other hand, has a very costly thread creation, both in terms of CPU and memory. But then they run in parallel using all the available CPUs. Data is only shared between threads when explicitly requested by the programmer and accessing the shared data has an important overhead.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-23 14:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found