2017.43 Hyper lands, racing…

The past week saw reliable support for .hyper and .race arrive, as described in Jonathan Worthington‘s blog post earlier this year. Now some operations can be made about 3x faster with just a few keystrokes. To give an example, these are some ways of obtaining the prime numbers below 100000:

$ time perl6 -e 'my @primes = ^100000 .grep: *.is-prime'
real 0m26.428s
user 0m26.440s

Where real is the wallclock time that passed, and user is the amount of CPU-time that was used. Now, by adding a simple .hyper:

$ time perl6 -e 'my @primes = ^100000 .hyper.grep: *.is-prime'
real 0m9.288s
user 0m31.354s

We go from 26 to 9 seconds wallclock time, which is almost 3x as fast. And if you’re not interested in the order of the final result, you can use .race:

$ time perl6 -e 'my @primes = ^100000 .race.grep: *.is-prime'
real 0m8.335s
user 0m32.106s

Which is well over 3x as fast.

A more real-world example is the test-t.pl test of Text::CSV. The --hyper version typically runs for 1.14 seconds, whereas the serial (normal) version runs for 2.57 seconds (timings all made on the quadcore machine that yours truly is using, so YMMV).

To execute code that only needs to be run once in a batch, you can use a once block:

$ perl6 -e '^100 .hyper.map: { once { say "started with $_" } }'
started with 0
started with 64

Unfortunately, it is not yet possible to use phasers inside hypered/raced blocks, mainly because we still need to figure out when e.g. a LAST phaser should fire: at the end of a batch? Or after the final call of the final batch?

Casual Contributors Welcome!

Ann Barcomb describes a number of useful strategies for managing what she calls “episodic contributors” in her blog post: “How to manage casual contributors to open source projects. I think we can all learn from this, so recommended reading!

More Perl 6 Videos

The uploads page of TPCiA videos shows some more Rakudo Perl 6 related videos this week:

Also, Rakudo Perl 6 – A Primer by Simon Proctor (from the last London Perl Mongers Technical Meeting). Enjoy!

2017.10 Release Delayed

Some showstoppery issues with Rakudo are delaying the 2017.10 release. As this release will most likely be used for the next Rakudo Star release, and thus will be used longer and more extensively, it was considered better to wait until these issues are dealt with, at least temporarily. So stay tuned!

Other Core Developments

As promised last week, a roundup of other core developments of the past 2 weeks:

  • Several issues with quoting in is-run on Windows were fixed by Zoffix Znet, allowing make test to run cleanly again.
  • Samantha McVey made IO::Path.parent take an Int to indicate how many levels to go up (default: 1).
  • David Warring made indexing into NativeCall‘s TypedPointer (aka AT-POS) at least 4x as fast.
  • Daniel Green improved the speed with which variables are interpolated in regular expressions (aka the internal INTERPOLATE subroutine).
  • Zoffix Znet fixed IO::Pipe.close so that the Proc object is always returned, instead of only by the .close on the last open handle. He also fixed some issues with Promise.in, and Promise.at, and very low values / negative values / values in the past.
  • Timo Paulssen added Promise.kept and Promise.broken as a quick way to generate a kept or broken Promise without needing to call Promise.new.
  • Zoffix Znet also fixed precedence issues with the Unicode versions , , and of the ASCII operators <=, >= and !=.
  • Elizabeth Mattijsen fixed an issue caused by a mismatch in the layout of the BUILDPLAN between nqp and Perl 6. She also improved the speed of initialization of native arrays and fixed issues with the handling of Failures by some set operators.
  • And many, many, many more smaller fixes and improvements, both internally as externally visible. Interested in seeing more? Check the ChangeLog or the latest commits.

Blog Posts

Meanwhile on Twitter

Meanwhile on StackOverflow

Meanwhile on perl6-users

Meanwhile on PerlMonks

Winding Down

Alas, no recent module information on CPAN just yet. We’ve been all too busy fixing bugs before the 2017.10 release. But you should check out the new MetaCPAN-like search functionality of modules.perl6.org! And while you all do that, I’ll be preparing for next week’s Perl 6 Weekly. See you then!

Got something to note?