A Date with CPAN, Part 8: Curse You, Daylight Savings Time!

[This is a post in my latest long-ass series.  You may want to begin at the beginning.  I do not promise that the next post in the series will be next week.  Just that I will eventually finish it, someday.  Unless I get hit by a bus.

IMPORTANT NOTE!  When I provide you links to code on GitHub, I’m giving you links to particular commits.  This allows me to show you the code as it was at the time the blog post was written and insures that the code references will make sense in the context of this post.  Just be aware that the latest version of the code may be very different.]

Last time I talked briefly about the raft of failures that CPAN Testers threw up for me to look at.  I mentioned that there were roughly 3 groups of failures, and that one of them was bigger than the other two.  I even gave a hint as to what it was in one of my examples:

Virtual Spring Cleaning (part 5 of X) in which I release Backblaze::B2(::Async)

I'm a sucker for early access to free APIs. So I quickly went forward when Backblaze opened up access to their B2 storage API, and implemented a client for it, Backblaze::B2. I feel a bit guilty for releasing a module without having a use case for it myself, but instead of letting it rot on my filesystem, I'm putting it out for others to use.

Stupid Regexp Trick: Fail on match

I found myself one day trying to come up with a regexp that matched numbers more or less the way Perl does. My first cut was

m/ \G \s* (?:
        (?<oct> 0b[01]+ | 0[0-7]+ | 0x[[:xdigit:]]+ ) |
        (?<float> [+-]?(?=\.?\d)\d*\.?\d*(?:e[+-]?\d+)? )
    (?! \w )

where the <oct> capture represents things that need to be run through the oct built-in, and the <float> capture comes from perlfaq4.

The problem here was that the <float> expression matched things like '09', which was not what I wanted. What I wanted was to have the entire expression fail if it got past the <oct> expression and found something beginning with '0', other than '0' itself.

SureVoIP is sponsoring the QA Hackathon

We're very happy to announce that SureVoIP are supporting the QA Hackthon as a gold sponsor.

SureVoIP® (Suretec Systems Ltd.) is an Ofcom-registered Internet Telephony Service Provider supplying Hosted VoIP solutions, SIP trunks, UK inbound numbers, International SIP numbers, a partner program, public API (powered by Catalyst) and other related VoIP products and services.

Optimizing nqp-js-on-js to make it fast enough to compile Rakudo

Having failed to find a working profiler on npm I ended up webpacking nqp-js-on-js and profiling it directly in Chrome.
It turns out the first big slowdown was the lack of multi caching.
I implemented them.
The second big slowdown was actually the slurp() function.
MoarVM doesn't handle concatenation large amounts of huge strings very well so the cross compiler so instead of concatenating bits of javascript code it's often much faster to write them to disk and then slurp it back in.
On the nqp-js-on-js due to a misset buffer size slurp turned out sluggish.
Due to profiling a webpacked version (which doesn't do IO as it runs in Chrome) this has baffled me for a bit.
Changing the nqp::readallfh buffer size from 10 to 32768 speed up stuff a lot and I'm back to compiling rakudo.
Based on the output of the profiling there seem to be a few low hanging fruit optimalizations for bunch of easy ~5% speedups but I'll work on them later on as having actual Perl 6 running instead of NQP will give me a better vision of how we want to optimize things.

I think subroutine signatures don't need arguments count checking

I think subroutine signatures don't need arguments count checking,
because performance is more important than utility.

Subroutine signature should be optimized from performance perspective, not utility.
Arguments count checking is one logic, so it damage run time performance.

And I like simple and compact syntax.

  sub foo($x, $y) {
  # same as
  sub foo {
    my ($x, $y) = @_;
  sub foo($x = 0, $y = 0) {

  # same as
  sub foo {
    my ($x, $y) = @_;
    $x //= 0;
    $y //= 0;

At first, it is good that only small syntax is introduced, not complex one.

And getting arguments count is optimized.

  # Should be fast
  my $count = @_;

  # Slow is ok in subroutine signature
  my $first = $_[0]
  my $second = $_[1]

Arguments count checking should be user responsibility, not default feature.

In static type language can do arguments count checking in compile time.
But in dynamic type language arguments count checking is run time cost.

PerlModules.net now sends emails!

I have updated perlmodules.net with an important feature.

PerlModules.net is a site that notifies you whenever your favorite Perl modules get updated.

Up until now, it let you track changes to your favorite modules through an RSS reader. If you wanted to receive email updates instead, you had to use an RSS-to-email gateway, but that didn't work too well (important color and styles were lost from the text, and the emails were full of advertisments).

From now, perlmodules.net sends its own emails to the users. It is opt-in, so if a user doesn't provide their e-mail address and check a checkbox at their feed's page, they won't receive any emails, plus all emails sent contain an easy unsubscription link at the bottom.

Try it out for yourself: https://www.perlmodules.net/

Call for Venue for YAPC::Europe::2017

Although YAPC::Europe::2016 preparations are well underway in Cluj, it is time for the venue committee of the YAPC::Europe Foundation (YEF) to think about the location of the 2017 conference. YAPC::Europe wouldn't exist without dedicated teams of volunteers, and we are always excited to see the enthusiasm and learn about the new ideas the community has to offer.

Further information about preparing a complete application can be found on our website. Proposals submitted to the venue committee will be added to this public repository (you may provide private information separately) to benefit future organizers.

The deadlines which apply to this portion of the procedure are:

Friday, 20 May: Deadline for sending a letter of intent. This letter simply expresses interest in hosting the conference and provides contact information (both email and telephone) for at least two organizers. This is an optional step but it can be to your advantage to alert the venue committee of your proposal.

Thursday, 7 July: Deadline for sending proposals to host YAPC::Europe 2017.

If you do not receive a confirmation for your letter of intent or proposal within a couple of days, please personally contact a member of the venue committee.

Please send your questions, letters of intent, and proposals to venue@yapceurope.org.

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl and offering the modern features you’ve come to expect in blog platforms, the site is hosted by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.