Skip Menu |

This queue is for tickets about the Dios CPAN distribution.

Report information
The Basics
Id: 121986
Status: open
Priority: 0/
Queue: Dios

People
Owner: Nobody in particular
Requestors: perl [...] toby.ink
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.001001
Fixed in: (no value)



Subject: contains a partial re-implementation of Types::Standard, but way slower
"Use CPAN modules where feasible." — Damian Conway, Perl Best Practices (ch 17)
Subject: dios-benchmark.pl
use strict; use warnings; use Benchmark qw(cmpthese); use Dios::Types qw(validate); use Types::Standard qw(ArrayRef Int); use Type::Tiny::XS qw(); # An array of ArrayRef[Int] of a variety of lengths my @arrays = map [0..$_], 1..500; cmpthese(-3, { dios_types => sub { validate('Array[Int]', $_) for @arrays }, type_tiny => sub { ArrayRef->of(Int)->assert_valid($_) for @arrays }, type_tiny_faster => sub { my $t = ArrayRef->of(Int); $t->assert_valid($_) for @arrays }, }); __END__ Rate dios_types type_tiny type_tiny_faster dios_types 3.70/s -- -64% -98% type_tiny 10.2/s 176% -- -95% type_tiny_faster 204/s 5403% 1894% --
Also: $ memusg perl -MTypes::Standard -e1 memusg: peak=6356 $ memusg perl -MDios::Types -e1 memusg: peak=20564
Subject: Re: [rt.cpan.org #121986] contains a partial re-implementation of Types::Standard, but way slower
Date: Sun, 18 Jun 2017 13:26:47 -0400
To: bug-Dios [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Thanks, Toby. Added near the top of the module's ToDo list. Won't make it into the imminent release this week, but definitely for the next release. Much appreciated, Damian
I've been writing my own declarative OO thing lately using Keyword::Declare and Moo, and benchmarking it against Dios, MooseX::Declare, etc. From my experiments, I'm still pretty convinced that type constraints are one of Dios's big performance bottlenecks. Would a patch rewriting Dios::Types as a wrapper around Types::Standard be likely to be accepted if I can do it without breaking any tests? Or is Dios mostly abandoned now? (No new releases in 2.5 years.)
Subject: Re: [rt.cpan.org #121986] contains a partial re-implementation of Types::Standard, but way slower
Date: Wed, 5 Feb 2020 20:32:59 +0000
To: bug-Dios [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Hi Toby, Show quoted text
> From my experiments, I'm still pretty convinced that type constraints > are one of Dios's big performance bottlenecks.
I would not be at all surprised. Show quoted text
> Would a patch rewriting Dios::Types as a wrapper around > Types::Standard be likely to be accepted if I can do it without > breaking any tests?
Absolutely. I'd be delighted. And would expedite a new release. Show quoted text
> Or is Dios mostly abandoned now? (No new releases in 2.5 years.)
I still have a few people using it, but they haven't reported any issues in that time, so I haven't needed to update it. I do have longer-term goals for it, including a full rewrite to use native fieldhashes and subs instead of Object::InsideOut, as well as adding more Rakuisms, such as roles and parameter deconstruction. The problem has been my complete lack of copious free time over the past few years; a problem does not seem likely to go away in the foreseeable future. :-( Damian