New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.race makes code run 5 times slower #5084
Comments
From @zoffixznetI was playing around and noticed that using .race makes this code actually run 5 times SLOWER. This a 2-core machine, so my expectations were the code would run 0%-100% FASTER than .race-less version. The produced results are consistent. Here's the normal version: $ perl6 -e '.base: 16 for ^100000; say now - INIT now' And here's the .race version: |
From @zoffixznetSee also a possibly-related RT#127365 with .hyper method, where slowness also appears, but only sporadically: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=127365 |
From @moritzHi, On Mon Jan 25 09:10:18 2016, cpan@zoffix.com wrote:
Since parallelization carries its own overhead, I'm not sure this expectation is justified. IMHO it's only justified if you do heavy lifting in each iteration (either CPU or IO), and so you can expect the overhead to small in comparison.
.base: 16 certain doesn't qualify as computational heavy. Ig might be interesting to see where .hyper spends its time, but I disagree that it being slower than the serial version is bug. Cheers, |
The RT System itself - Status changed from 'new' to 'open' |
From @zoffixznetOn Tue Jan 26 00:11:01 2016, moritz wrote:
I should've remembered to test with :batch in my OP, but even if I split the operation into 4 batches, it comes out 2.2 times SLOWER than non-paraller version. Surely 250,000 calls to .base would classify as heavy lifting. This is on a 4-core box: zoffix@ZofMain:~$ perl6 -e '.base: 16 for ^1_000_000; say now - INIT now' |
@zoffixznet - Status changed from 'open' to 'rejected' |
Migrated from rt.perl.org#127364 (status was 'rejected')
Searchable as RT127364$
The text was updated successfully, but these errors were encountered: