Skip Menu |

This queue is for tickets about the SQL-Abstract-More CPAN distribution.

Report information
The Basics
Id: 99182
Status: resolved
Priority: 0/
Queue: SQL-Abstract-More

People
Owner: Nobody in particular
Requestors: ZDM [...] cpan.org
Cc:
AdminCc:

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



Subject: Is it possible to do not use Scalar::Does as dependency?
Is it possible to exclude Scalar::Does from dependencies? Scalar::Does increase memory footprint ~10Mb and depends on a whole family of Types::Tiny::* packages. This is very hard dependency. You can write: Scalar::Util::reftype($a) eq 'ARRAY' || ( Scalar::Util::blessed($a) && overload::Method( $a, '@{}' ) ? 1 : 0 ); instead of: Scalar::Does::does( $val, 'ARRAY' ); and Scalar::Util::reftype($a) eq 'HASH' || ( Scalar::Util::blessed($a) && overload::Method( $a, '%{}' ) ? 1 : 0 ); instead of: Scalar::Does::does( $val, 'HASH' );
Subject: Re: [rt.cpan.org #99182] Is it possible to do not use Scalar::Does as dependency?
Date: Sun, 28 Sep 2014 05:14:45 +0200
To: bug-SQL-Abstract-More [...] rt.cpan.org
From: Laurent Dami <laurent.dami [...] free.fr>
Le 27.09.2014 22:54, Dmytro Zagashev via RT a écrit : Show quoted text
> Sat Sep 27 16:54:55 2014: Request 99182 was acted upon. > Transaction: Ticket created by ZDM > Queue: SQL-Abstract-More > Subject: Is it possible to do not use Scalar::Does as dependency? > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: ZDM@cpan.org > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=99182 > > > > Is it possible to exclude Scalar::Does from dependencies? > > Scalar::Does increase memory footprint ~10Mb and depends on a whole family of Types::Tiny::* packages. > >
Hi Dmytro, Thanks for the suggestion, but do you have any evidence of this 10MB increase in memory footprint ? I just tried a simple stupid program with an without Scalar::Does, the difference in process vmem size is just 450K. Which tools did you use ? Laurent D.
Subject: Re: [rt.cpan.org #99182] Is it possible to do not use Scalar::Does as dependency?
Date: Sun, 28 Sep 2014 12:24:42 +0300
To: bug-SQL-Abstract-More [...] rt.cpan.org
From: "dzagashev [...] gmail.com" <dzagashev [...] gmail.com>
Hi. You should look at RES. #!/usr/bin/env perl # RES = 1908 # VIRT = 117M print 'Press ENTER to continue...'; <STDIN>; require Scalar::Does; # RES = 8892 # VIRT = 136M print 'Press ENTER to continue...'; <STDIN>; 1; __END__ On 28.09.2014 6:14, laurent.dami@free.fr via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=99182 > > > Le 27.09.2014 22:54, Dmytro Zagashev via RT a écrit :
>> Sat Sep 27 16:54:55 2014: Request 99182 was acted upon. >> Transaction: Ticket created by ZDM >> Queue: SQL-Abstract-More >> Subject: Is it possible to do not use Scalar::Does as dependency? >> Broken in: (no value) >> Severity: (no value) >> Owner: Nobody >> Requestors: ZDM@cpan.org >> Status: new >> Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=99182 > >> >> >> Is it possible to exclude Scalar::Does from dependencies? >> >> Scalar::Does increase memory footprint ~10Mb and depends on a whole family of Types::Tiny::* packages. >> >>
> Hi Dmytro, > > Thanks for the suggestion, but do you have any evidence of this 10MB > increase in memory footprint ? I just tried a simple stupid program with > an without Scalar::Does, the difference in process vmem size is just > 450K. Which tools did you use ? > > Laurent D. > >
That's testing against an "empty Perl". It's about 5 MB on my machine, but this is only 32-bits, so most stuff uses half as much memory. However, you're not taking into account that Scalar::Does and Type::Tiny load a lot of modules that SQL::Abstract::More would be (directly or indirectly) loading anyway. Things like strict, warnings, overload, Scalar::Util, Sub::Name, etc. When you take that into account, Scalar::Does is costing only about 2.6MB. If you used Types::Standard directly, it would be more like 2.2MB.
Subject: Re: [rt.cpan.org #99182] Is it possible to do not use Scalar::Does as dependency?
Date: Mon, 29 Sep 2014 04:08:33 +0300
To: bug-SQL-Abstract-More [...] rt.cpan.org
From: "dzagashev [...] gmail.com" <dzagashev [...] gmail.com>
In my projects I use most of standard perl modules but still has increasing memory approx. 7 Mb when use Scalar::Does or Type::Tiny. Type::Tiny is is perfect and give us universal approach for types checking. But it has a huge code base - this is a fee for versatility. I just want to say, that not necessary to include all Type::Tiny code for simple checking of reference type in SQL::Abstaract::More. On 28.09.2014 23:04, Toby Inkster via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=99182 > > > That's testing against an "empty Perl". It's about 5 MB on my machine, but this is only 32-bits, so most stuff uses half as much memory. > > However, you're not taking into account that Scalar::Does and Type::Tiny load a lot of modules that SQL::Abstract::More would be (directly or indirectly) loading anyway. Things like strict, warnings, overload, Scalar::Util, Sub::Name, etc. When you take that into account, Scalar::Does is costing only about 2.6MB. > > If you used Types::Standard directly, it would be more like 2.2MB.
Subject: Re: [rt.cpan.org #99182] Is it possible to do not use Scalar::Does as dependency?
Date: Mon, 29 Sep 2014 04:27:19 +0300
To: bug-SQL-Abstract-More [...] rt.cpan.org
From: "dzagashev [...] gmail.com" <dzagashev [...] gmail.com>
If I comment SQL::Abstract::More.pm line 13: # use Scalar::Does qw/does/; I got memory consumption decreased from 10768 to 6200. On 28.09.2014 23:04, Toby Inkster via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=99182 > > > That's testing against an "empty Perl". It's about 5 MB on my machine, but this is only 32-bits, so most stuff uses half as much memory. > > However, you're not taking into account that Scalar::Does and Type::Tiny load a lot of modules that SQL::Abstract::More would be (directly or indirectly) loading anyway. Things like strict, warnings, overload, Scalar::Util, Sub::Name, etc. When you take that into account, Scalar::Does is costing only about 2.6MB. > > If you used Types::Standard directly, it would be more like 2.2MB.
Subject: Re: [rt.cpan.org #99182] Is it possible to do not use Scalar::Does as dependency?
Date: Mon, 29 Sep 2014 04:36:00 +0300
To: bug-SQL-Abstract-More [...] rt.cpan.org
From: "dzagashev [...] gmail.com" <dzagashev [...] gmail.com>
We should watch for memory consumption everywhere or once we get 500Mb processes. On 29.09.2014 4:08, dzagashev@gmail.com via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=99182 > > > In my projects I use most of standard perl modules but still has > increasing memory approx. 7 Mb when use Scalar::Does or Type::Tiny. > > Type::Tiny is is perfect and give us universal approach for types checking. > > But it has a huge code base - this is a fee for versatility. > > I just want to say, that not necessary to include all Type::Tiny code > for simple checking of reference type in SQL::Abstaract::More. > > On 28.09.2014 23:04, Toby Inkster via RT wrote:
>> <URL: https://rt.cpan.org/Ticket/Display.html?id=99182 > >> >> That's testing against an "empty Perl". It's about 5 MB on my machine, but this is only 32-bits, so most stuff uses half as much memory. >> >> However, you're not taking into account that Scalar::Does and Type::Tiny load a lot of modules that SQL::Abstract::More would be (directly or indirectly) loading anyway. Things like strict, warnings, overload, Scalar::Util, Sub::Name, etc. When you take that into account, Scalar::Does is costing only about 2.6MB. >> >> If you used Types::Standard directly, it would be more like 2.2MB.
> >
Subject: Re: [rt.cpan.org #99182] Is it possible to do not use Scalar::Does as dependency?
Date: Fri, 03 Oct 2014 21:40:51 +0200
To: bug-SQL-Abstract-More [...] rt.cpan.org
From: Laurent Dami <laurent.dami [...] free.fr>
Le 29.09.2014 03:08, dzagashev@gmail.com via RT a écrit : Show quoted text
> Queue: SQL-Abstract-More > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=99182 > > > In my projects I use most of standard perl modules but still has > increasing memory approx. 7 Mb when use Scalar::Does or Type::Tiny. > > Type::Tiny is is perfect and give us universal approach for types checking. > > But it has a huge code base - this is a fee for versatility. > > I just want to say, that not necessary to include all Type::Tiny code > for simple checking of reference type in SQL::Abstaract::More.
I hadn't upgraded Scalar::Does for a while, so now I realize that indeed it has become much fatter in the latest relases. So I agree with you, SQL::Abstract::More doesn't need all of this power, so I will follow your suggestion and just program it directly. Thanks for the advice, Laurent D.
shipped v1.24 to CPAN