Skip to content
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

Reduce memory needed for Data::Dumper #15716

Closed
p5pRT opened this issue Nov 14, 2016 · 18 comments
Closed

Reduce memory needed for Data::Dumper #15716

p5pRT opened this issue Nov 14, 2016 · 18 comments
Labels
dist-Data-Dumper issues in the dual-life blead-first Data-Dumper distribution

Comments

@p5pRT
Copy link

p5pRT commented Nov 14, 2016

Migrated from rt.perl.org#130101 (status was 'resolved')

Searchable as RT130101$

@p5pRT
Copy link
Author

p5pRT commented Nov 14, 2016

From @bdraco

This is a bug report for perl from nick@​cpanel.net,
generated with the help of perlbug 1.40 running under perl 5.24.1.


[Please describe your issue here]

Please see attached patch

@p5pRT
Copy link
Author

p5pRT commented Nov 14, 2016

From @bdraco

0001-dist-Data-Dumper-Dumper.pm-Reduce-memory-usage-by-re.patch
From 5350cea83c5386e16d5197652fb8bf0f1512dda7 Mon Sep 17 00:00:00 2001
From: "J. Nick Koston" <nick@cpanel.net>
Date: Mon, 14 Nov 2016 03:57:14 -0600
Subject: [PATCH] dist/Data-Dumper/Dumper.pm: Reduce memory usage by removing
 overload                             and not importing Carp

---
 dist/Data-Dumper/Changes   |  5 +++++
 dist/Data-Dumper/Dumper.pm | 21 ++++++++++-----------
 2 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/dist/Data-Dumper/Changes b/dist/Data-Dumper/Changes
index f9ea53f..ce5a57f 100644
--- a/dist/Data-Dumper/Changes
+++ b/dist/Data-Dumper/Changes
@@ -6,6 +6,11 @@ Changes - public release history for Data::Dumper
 
 =over 8
 
+=item 2.162 (Nov 14 2016)
+
+Reduce memory usage by not importing from Carp
+Reduce memory usage by removing unused overload require.
+
 =item 2.161 (Jul 11 2016)
 
 Perl 5.12 fix/workaround until fixed PPPort release.
diff --git a/dist/Data-Dumper/Dumper.pm b/dist/Data-Dumper/Dumper.pm
index f461969..7afbd44 100644
--- a/dist/Data-Dumper/Dumper.pm
+++ b/dist/Data-Dumper/Dumper.pm
@@ -17,9 +17,8 @@ BEGIN {
 
 use 5.006_001;
 require Exporter;
-require overload;
 
-use Carp;
+use Carp ();
 
 BEGIN {
     @ISA = qw(Exporter);
@@ -70,7 +69,7 @@ $Maxrecurse = 1000      unless defined $Maxrecurse;
 sub new {
   my($c, $v, $n) = @_;
 
-  croak "Usage:  PACKAGE->new(ARRAYREF, [ARRAYREF])"
+  Carp::croak("Usage:  PACKAGE->new(ARRAYREF, [ARRAYREF])")
     unless (defined($v) && (ref($v) eq 'ARRAY'));
   $n = [] unless (defined($n) && (ref($n) eq 'ARRAY'));
 
@@ -170,11 +169,11 @@ sub Seen {
           $s->{seen}{$id} = [$k, $v];
         }
         else {
-          carp "Only refs supported, ignoring non-ref item \$$k";
+          Carp::carp("Only refs supported, ignoring non-ref item \$$k");
         }
       }
       else {
-        carp "Value of ref must be defined; ignoring undefined item \$$k";
+        Carp::carp("Value of ref must be defined; ignoring undefined item \$$k");
       }
     }
     return $s;
@@ -195,7 +194,7 @@ sub Values {
       return $s;
     }
     else {
-      croak "Argument to Values, if provided, must be array ref";
+      Carp::croak("Argument to Values, if provided, must be array ref");
     }
   }
   else {
@@ -214,7 +213,7 @@ sub Names {
       return $s;
     }
     else {
-      croak "Argument to Names, if provided, must be array ref";
+      Carp::croak("Argument to Names, if provided, must be array ref");
     }
   }
   else {
@@ -439,7 +438,7 @@ sub _dump {
         if (ref($s->{sortkeys}) eq 'CODE') {
           $keys = $s->{sortkeys}($val);
           unless (ref($keys) eq 'ARRAY') {
-            carp "Sortkeys subroutine did not return ARRAYREF";
+            Carp::carp("Sortkeys subroutine did not return ARRAYREF");
             $keys = [];
           }
         }
@@ -492,11 +491,11 @@ sub _dump {
       }
       else {
         $out .= 'sub { "DUMMY" }';
-        carp "Encountered CODE ref, using dummy placeholder" if $s->{purity};
+        Carp::carp("Encountered CODE ref, using dummy placeholder") if $s->{purity};
       }
     }
     else {
-      croak "Can't handle '$realtype' type";
+      Carp::croak("Can't handle '$realtype' type");
     }
 
     if ($realpack and !$no_bless) { # we have a blessed ref
@@ -1472,7 +1471,7 @@ modify it under the same terms as Perl itself.
 
 =head1 VERSION
 
-Version 2.162  (September 21 2016)
+Version 2.162  (November 14 2016)
 
 =head1 SEE ALSO
 
-- 
2.10.2

@p5pRT
Copy link
Author

p5pRT commented Nov 14, 2016

From @bdraco

Perl Info

Flags:
   category=library
   severity=low
   module=Data::Dumper

Site configuration information for perl 5.24.1:

Configured by cPanel at Mon Nov 14 08:49:50 CST 2016.

Summary of my perl5 (revision 5 version 24 subversion 1) configuration:

 Platform:
   osname=linux, osvers=2.6.32-431.29.2.el6.x86_64, archname=x86_64-linux-64int
   uname='linux rpmb-64-centos-65.dev.cpanel.net 2.6.32-431.29.2.el6.x86_64 #1 smp tue sep 9 21:36:05 utc 2014 x86_64 x86_64 x86_64 gnulinux '
   config_args='-des -Dusedevel -Darchname=x86_64-linux-64int -Dcc=/usr/bin/gcc -Dcpp=/usr/bin/cpp -Dusemymalloc=n -DDEBUGGING=none -Doptimize=-Os -Accflags=-m64 -DPERLIOBUF_DEFAULT_BUFSIZ=32768 -Dccflags=-DPERL_DISABLE_PMC -fPIC -DPIC -I/usr/local/cpanel/3rdparty/perl/524/include -L/usr/local/cpanel/3rdparty/perl/524/lib64 -I/usr/local/cpanel/3rdparty/include -L/usr/local/cpanel/3rdparty/lib64 -Duseshrplib -Duselargefiles=yes -Duseposix=true -Dhint=recommended -Duseperlio=yes -Dcppflags=-I/usr/local/cpanel/3rdparty/perl/524/include -L/usr/local/cpanel/3rdparty/perl/524/lib64 -I/usr/local/cpanel/3rdparty/include -L/usr/local/cpanel/3rdparty/lib64 -Dldflags=-Wl,-rpath -Wl,/usr/local/cpanel/3rdparty/perl/524/lib64 -L/usr/local/cpanel/3rdparty/perl/524/lib64 -L/usr/local/cpanel/3rdparty/lib64 -Dprefix=/usr/local/cpanel/3rdparty/perl/524 -Dsiteprefix=/opt/cpanel/perl5/524 -Dsitebin=/opt/cpanel/perl5/524/bin -Dsitelib=/opt/cpanel/perl5/524/site_lib -Dusevendorprefix=true -Dvendorbin=/usr/local/cpanel/3rdparty/perl/524/bin -Dvendorprefix=/usr/local/cpanel/3rdparty/perl/524/lib64/perl5 -Dvendorlib=/usr/local/cpanel/3rdparty/perl/524/lib64/perl5/cpanel_lib -Dprivlib=/usr/local/cpanel/3rdparty/perl/524/lib64/perl5/5.24.1 -Dman1dir=none -Dman3dir=none -Dscriptdir=/usr/local/cpanel/3rdparty/perl/524/bin -Dscriptdirexp=/usr/local/cpanel/3rdparty/perl/524/bin -Dsiteman1dir=none -Dsiteman3dir=none -Dinstallman1dir=none -Dversiononly=no -Dinstallusrbinperl=no -Dcf_by=cPanel -Dmyhostname=localhost -Dperladmin=root@localhost -Dcf_email=support@cpanel.net -Di_dbm=/usr/local/cpanel/3rdparty/include -Di_gdbm=/usr/local/cpanel/3rdparty/include -Di_ndbm=/usr/local/cpanel/3rdparty/include -DDB_File=true -Ud_dosuid -Uuserelocatableinc -Umad -Uusethreads -Uusemultiplicity -Uusesocks -Uuselongdouble -Aldflags=-L/usr/local/cpanel/3rdparty/perl/524/lib64 -L/usr/local/cpanel/3rdparty/lib64 -L/usr/lib64 -L/lib64 -lgdbm -Dlocincpth=/usr/local/cpanel/3rdparty/perl/524/include /usr/local/cpanel/3rdparty/include /usr/local/include  -Duse64bitint -Uuse64bitall -Dlibpth=/usr/local/cpanel/3rdparty/perl/524/lib64 /usr/local/cpanel/3rdparty/lib64 /usr/local/lib64 /usr/local/lib /lib64 /usr/lib64 '
   hint=recommended, useposix=true, d_sigaction=define
   useithreads=undef, usemultiplicity=undef
   use64bitint=define, use64bitall=undef, uselongdouble=undef
   usemymalloc=n, bincompat5005=undef
 Compiler:
   cc='/usr/bin/gcc', ccflags ='-DPERL_DISABLE_PMC -fPIC -DPIC -I/usr/local/cpanel/3rdparty/perl/524/include -L/usr/local/cpanel/3rdparty/perl/524/lib64 -I/usr/local/cpanel/3rdparty/include -L/usr/local/cpanel/3rdparty/lib64 -m64 -DPERLIOBUF_DEFAULT_BUFSIZ=32768 -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2',
   optimize='-Os',
   cppflags='-I/usr/local/cpanel/3rdparty/perl/524/include -L/usr/local/cpanel/3rdparty/perl/524/lib64 -I/usr/local/cpanel/3rdparty/include -L/usr/local/cpanel/3rdparty/lib64 -DPERL_DISABLE_PMC -fPIC -DPIC -I/usr/local/cpanel/3rdparty/perl/524/include -L/usr/local/cpanel/3rdparty/perl/524/lib64 -I/usr/local/cpanel/3rdparty/include -L/usr/local/cpanel/3rdparty/lib64 -m64 -DPERLIOBUF_DEFAULT_BUFSIZ=32768 -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
   ccversion='', gccversion='4.4.7 20120313 (Red Hat 4.4.7-4)', gccosandvers=''
   intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678, doublekind=3
   d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16, longdblkind=3
   ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
   alignbytes=8, prototype=define
 Linker and Libraries:
   ld='/usr/bin/gcc', ldflags ='-Wl,-rpath -Wl,/usr/local/cpanel/3rdparty/perl/524/lib64 -L/usr/local/cpanel/3rdparty/perl/524/lib64 -L/usr/local/cpanel/3rdparty/lib64 -L/usr/local/cpanel/3rdparty/perl/524/lib64 -L/usr/local/cpanel/3rdparty/lib64 -L/usr/lib64 -L/lib64 -lgdbm -fstack-protector -L/usr/local/lib'
   libpth=/usr/local/cpanel/3rdparty/perl/524/lib64 /usr/local/cpanel/3rdparty/lib64 /usr/local/lib64 /usr/local/lib /lib64 /usr/lib64 /usr/local/lib /usr/lib /lib/../lib64 /usr/lib/../lib64 /lib
   libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
   perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
   libc=libc-2.12.so, so=so, useshrplib=true, libperl=libperl.so
   gnulibc_version='2.12'
 Dynamic Linking:
   dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/usr/local/cpanel/3rdparty/perl/524/lib64/perl5/5.24.1/x86_64-linux-64int/CORE'
   cccdlflags='-fPIC', lddlflags='-shared -Os -L/usr/local/cpanel/3rdparty/perl/524/lib64 -L/usr/local/cpanel/3rdparty/lib64 -L/usr/lib64 -L/lib64 -L/usr/local/lib -fstack-protector'

Locally applied patches:
   RC3
   cPanel patches
   cPanel INC path changes
   Remove . from @INC


@INC for perl 5.24.1:
   /usr/local/cpanel
   /usr/local/cpanel/3rdparty/perl/524/lib64/perl5/cpanel_lib/x86_64-linux-64int
   /usr/local/cpanel/3rdparty/perl/524/lib64/perl5/cpanel_lib
   /usr/local/cpanel/3rdparty/perl/524/lib64/perl5/5.24.1/x86_64-linux-64int
   /usr/local/cpanel/3rdparty/perl/524/lib64/perl5/5.24.1
   /opt/cpanel/perl5/524/site_lib/x86_64-linux-64int
   /opt/cpanel/perl5/524/site_lib


Environment for perl 5.24.1:
   HOME=/root
   LANG=en_US.UTF-8
   LANGUAGE (unset)
   LD_LIBRARY_PATH (unset)
   LOGDIR (unset)
   PATH=/root/bin:/usr/local/cpanel/bin:/usr/local/cpanel/3rdparty/bin:/usr/local/cpanel/3rdparty/perl/524/bin:/usr/local/cpanel/3rdparty/perl/522/bin:/usr/local/cpanel/3rdparty/perl/514/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/cpanel/composer/bin:/usr/local/easy/bin
   PERL_BADLANG (unset)
   SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Nov 14, 2016

From @jkeenan

On Mon, 14 Nov 2016 17​:18​:19 GMT, bdraco wrote​:

This is a bug report for perl from nick@​cpanel.net,
generated with the help of perlbug 1.40 running under perl 5.24.1.

-----------------------------------------------------------------
[Please describe your issue here]

Please see attached patch

In your patch there's a discrepancy between the version issuance dates listed in 'Changes'​:

#####
+=item 2.162 (Nov 14 2016)
+
+Reduce memory usage by not importing from Carp
+Reduce memory usage by removing unused overload require.
+
=item 2.161 (Jul 11 2016)
#####

... and those listed in dist/Data-Dumper/Dumper.pm​:

#####
=head1 VERSION

-Version 2.162 (September 21 2016)
+Version 2.162 (November 14 2016)

#####

Can you investigate?

Thank you very much.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Nov 14, 2016

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Nov 16, 2016

From @tonycoz

On Mon, 14 Nov 2016 09​:18​:19 -0800, bdraco wrote​:

Please see attached patch

Besides the version number issues Jim pointed out​:

- the patch appears to be against 5.24.1-RC, but should be against
  bleadperl, and so doesn't apply cleanly to blead.

- the commit message subject is overlong with unusual spacing

Tony

@p5pRT
Copy link
Author

p5pRT commented Nov 17, 2016

From @bdraco

I updated the Changes file to pull in the ones that had not been documented and bumped the version numbers.

Please see attached.

Thanks
-Nick

@p5pRT
Copy link
Author

p5pRT commented Nov 17, 2016

From @bdraco

0001-dist-Data-Dumper-Dumper.pm-Reduce-memory-usage-by-re.patch
From 4513801b24459ee388bba43d7b02c1ef8e5075db Mon Sep 17 00:00:00 2001
From: "J. Nick Koston" <nick@cpanel.net>
Date: Mon, 14 Nov 2016 03:57:14 -0600
Subject: [PATCH] dist/Data-Dumper/Dumper.pm: Reduce memory usage by removing
 overload                             and not importing Carp  
 dist/Data-Dumper/Changes: Add missing Changes from git log

---
 dist/Data-Dumper/Changes   | 12 ++++++++++++
 dist/Data-Dumper/Dumper.pm | 23 +++++++++++------------
 2 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/dist/Data-Dumper/Changes b/dist/Data-Dumper/Changes
index f9ea53f..beeb25c 100644
--- a/dist/Data-Dumper/Changes
+++ b/dist/Data-Dumper/Changes
@@ -6,6 +6,18 @@ Changes - public release history for Data::Dumper
 
 =over 8
 
+=item 2.163 (Nov 14 2016)
+
+Reduce memory usage by not importing from Carp
+
+Reduce memory usage by removing unused overload require.
+
+switch to using SvPVCLEAR()
+
+=item 2.162 (Sep 21 2016)
+
+Change sv_setpvn(..., "...", ...) to sv_setpvs(..., "...")
+
 =item 2.161 (Jul 11 2016)
 
 Perl 5.12 fix/workaround until fixed PPPort release.
diff --git a/dist/Data-Dumper/Dumper.pm b/dist/Data-Dumper/Dumper.pm
index f461969..865b90a 100644
--- a/dist/Data-Dumper/Dumper.pm
+++ b/dist/Data-Dumper/Dumper.pm
@@ -10,16 +10,15 @@
 package Data::Dumper;
 
 BEGIN {
-    $VERSION = '2.162'; # Don't forget to set version and release
+    $VERSION = '2.163'; # Don't forget to set version and release
 }               # date in POD below!
 
 #$| = 1;
 
 use 5.006_001;
 require Exporter;
-require overload;
 
-use Carp;
+use Carp ();
 
 BEGIN {
     @ISA = qw(Exporter);
@@ -70,7 +69,7 @@ $Maxrecurse = 1000      unless defined $Maxrecurse;
 sub new {
   my($c, $v, $n) = @_;
 
-  croak "Usage:  PACKAGE->new(ARRAYREF, [ARRAYREF])"
+  Carp::croak("Usage:  PACKAGE->new(ARRAYREF, [ARRAYREF])")
     unless (defined($v) && (ref($v) eq 'ARRAY'));
   $n = [] unless (defined($n) && (ref($n) eq 'ARRAY'));
 
@@ -170,11 +169,11 @@ sub Seen {
           $s->{seen}{$id} = [$k, $v];
         }
         else {
-          carp "Only refs supported, ignoring non-ref item \$$k";
+          Carp::carp("Only refs supported, ignoring non-ref item \$$k");
         }
       }
       else {
-        carp "Value of ref must be defined; ignoring undefined item \$$k";
+        Carp::carp("Value of ref must be defined; ignoring undefined item \$$k");
       }
     }
     return $s;
@@ -195,7 +194,7 @@ sub Values {
       return $s;
     }
     else {
-      croak "Argument to Values, if provided, must be array ref";
+      Carp::croak("Argument to Values, if provided, must be array ref");
     }
   }
   else {
@@ -214,7 +213,7 @@ sub Names {
       return $s;
     }
     else {
-      croak "Argument to Names, if provided, must be array ref";
+      Carp::croak("Argument to Names, if provided, must be array ref");
     }
   }
   else {
@@ -439,7 +438,7 @@ sub _dump {
         if (ref($s->{sortkeys}) eq 'CODE') {
           $keys = $s->{sortkeys}($val);
           unless (ref($keys) eq 'ARRAY') {
-            carp "Sortkeys subroutine did not return ARRAYREF";
+            Carp::carp("Sortkeys subroutine did not return ARRAYREF");
             $keys = [];
           }
         }
@@ -492,11 +491,11 @@ sub _dump {
       }
       else {
         $out .= 'sub { "DUMMY" }';
-        carp "Encountered CODE ref, using dummy placeholder" if $s->{purity};
+        Carp::carp("Encountered CODE ref, using dummy placeholder") if $s->{purity};
       }
     }
     else {
-      croak "Can't handle '$realtype' type";
+      Carp::croak("Can't handle '$realtype' type");
     }
 
     if ($realpack and !$no_bless) { # we have a blessed ref
@@ -1472,7 +1471,7 @@ modify it under the same terms as Perl itself.
 
 =head1 VERSION
 
-Version 2.162  (September 21 2016)
+Version 2.163  (November 14 2016)
 
 =head1 SEE ALSO
 
-- 
2.10.2

@p5pRT
Copy link
Author

p5pRT commented Nov 17, 2016

From @bdraco

On Nov 14, 2016, at 11​:36 PM, James E Keenan via RT <perlbug-followup@​perl.org> wrote​:

On Mon, 14 Nov 2016 17​:18​:19 GMT, bdraco wrote​:

This is a bug report for perl from nick@​cpanel.net,
generated with the help of perlbug 1.40 running under perl 5.24.1.

-----------------------------------------------------------------
[Please describe your issue here]

Please see attached patch

In your patch there's a discrepancy between the version issuance dates listed in 'Changes'​:

#####
+=item 2.162 (Nov 14 2016)
+
+Reduce memory usage by not importing from Carp
+Reduce memory usage by removing unused overload require.
+
=item 2.161 (Jul 11 2016)
#####

... and those listed in dist/Data-Dumper/Dumper.pm​:

#####
=head1 VERSION

-Version 2.162 (September 21 2016)
+Version 2.162 (November 14 2016)

#####

Can you investigate?

Thank you very much.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Nov 17, 2016

From @bdraco

Is there a guide to how commit messages should be formatted?

Thanks

Sent from my Mobile

On Nov 15, 2016, at 6​:32 PM, Tony Cook via RT <perlbug-followup@​perl.org> wrote​:

On Mon, 14 Nov 2016 09​:18​:19 -0800, bdraco wrote​:
Please see attached patch

Besides the version number issues Jim pointed out​:

- the patch appears to be against 5.24.1-RC, but should be against
bleadperl, and so doesn't apply cleanly to blead.

- the commit message subject is overlong with unusual spacing

Tony

@p5pRT
Copy link
Author

p5pRT commented Nov 17, 2016

From @tonycoz

On Wed, 16 Nov 2016 17​:20​:26 -0800, bdraco wrote​:

Is there a guide to how commit messages should be formatted?

https://github.com/Perl/perl5/blob/blead/pod/perlhack.pod#commit-message

Your latest patch is still against maint, and needs to be against blead perl.

Tony

@p5pRT
Copy link
Author

p5pRT commented Nov 18, 2016

From @atoomic

Here is the patch rebase on blead, which should apply cleanly for now

On Wed, 16 Nov 2016 18​:07​:58 -0800, tonyc wrote​:

On Wed, 16 Nov 2016 17​:20​:26 -0800, bdraco wrote​:

Is there a guide to how commit messages should be formatted?

https://github.com/Perl/perl5/blob/blead/pod/perlhack.pod#commit-
message

Your latest patch is still against maint, and needs to be against
blead perl.

Tony

@p5pRT
Copy link
Author

p5pRT commented Nov 18, 2016

From @atoomic

0001-dist-Data-Dumper-Dumper.pm-Reduce-memory-usage-by-re.patch
From 8339d4a35521e77a297804ee3282532ea38664f5 Mon Sep 17 00:00:00 2001
From: "J. Nick Koston" <nick@cpanel.net>
Date: Mon, 14 Nov 2016 03:57:14 -0600
Subject: [PATCH] dist/Data-Dumper/Dumper.pm: Reduce memory usage by removing
 overload and not importing Carp


diff --git a/dist/Data-Dumper/Changes b/dist/Data-Dumper/Changes
index 9828fe0..728be78 100644
--- a/dist/Data-Dumper/Changes
+++ b/dist/Data-Dumper/Changes
@@ -11,6 +11,11 @@ Changes - public release history for Data::Dumper
 The XS implementation now handles the C<Deparse> option, so using it no
 longer forces use of the pure-Perl version.
 
+=item 2.162 (Nov 14 2016)
+
+Reduce memory usage by not importing from Carp
+Reduce memory usage by removing unused overload require.
+
 =item 2.161 (Jul 11 2016)
 
 Perl 5.12 fix/workaround until fixed PPPort release.
diff --git a/dist/Data-Dumper/Dumper.pm b/dist/Data-Dumper/Dumper.pm
index 8e3e4f1..6a96a61 100644
--- a/dist/Data-Dumper/Dumper.pm
+++ b/dist/Data-Dumper/Dumper.pm
@@ -17,9 +17,8 @@ BEGIN {
 
 use 5.006_001;
 require Exporter;
-require overload;
 
-use Carp;
+use Carp ();
 
 BEGIN {
     @ISA = qw(Exporter);
@@ -70,7 +69,7 @@ $Maxrecurse = 1000      unless defined $Maxrecurse;
 sub new {
   my($c, $v, $n) = @_;
 
-  croak "Usage:  PACKAGE->new(ARRAYREF, [ARRAYREF])"
+  Carp::croak("Usage:  PACKAGE->new(ARRAYREF, [ARRAYREF])")
     unless (defined($v) && (ref($v) eq 'ARRAY'));
   $n = [] unless (defined($n) && (ref($n) eq 'ARRAY'));
 
@@ -170,11 +169,11 @@ sub Seen {
           $s->{seen}{$id} = [$k, $v];
         }
         else {
-          carp "Only refs supported, ignoring non-ref item \$$k";
+          Carp::carp("Only refs supported, ignoring non-ref item \$$k");
         }
       }
       else {
-        carp "Value of ref must be defined; ignoring undefined item \$$k";
+        Carp::carp("Value of ref must be defined; ignoring undefined item \$$k");
       }
     }
     return $s;
@@ -195,7 +194,7 @@ sub Values {
       return $s;
     }
     else {
-      croak "Argument to Values, if provided, must be array ref";
+      Carp::croak("Argument to Values, if provided, must be array ref");
     }
   }
   else {
@@ -214,7 +213,7 @@ sub Names {
       return $s;
     }
     else {
-      croak "Argument to Names, if provided, must be array ref";
+      Carp::croak("Argument to Names, if provided, must be array ref");
     }
   }
   else {
@@ -438,7 +437,7 @@ sub _dump {
         if (ref($s->{sortkeys}) eq 'CODE') {
           $keys = $s->{sortkeys}($val);
           unless (ref($keys) eq 'ARRAY') {
-            carp "Sortkeys subroutine did not return ARRAYREF";
+            Carp::carp("Sortkeys subroutine did not return ARRAYREF");
             $keys = [];
           }
         }
@@ -491,11 +490,11 @@ sub _dump {
       }
       else {
         $out .= 'sub { "DUMMY" }';
-        carp "Encountered CODE ref, using dummy placeholder" if $s->{purity};
+        Carp::carp("Encountered CODE ref, using dummy placeholder") if $s->{purity};
       }
     }
     else {
-      croak "Can't handle '$realtype' type";
+      Carp::croak("Can't handle '$realtype' type");
     }
 
     if ($realpack and !$no_bless) { # we have a blessed ref
@@ -1466,7 +1465,7 @@ modify it under the same terms as Perl itself.
 
 =head1 VERSION
 
-Version 2.164  (November 12 2016)
+Version 2.164  (November 14 2016)
 
 =head1 SEE ALSO
 
-- 
2.10.2

@p5pRT
Copy link
Author

p5pRT commented Nov 28, 2016

From @tonycoz

On Fri, 18 Nov 2016 10​:52​:39 -0800, atoomic wrote​:

Here is the patch rebase on blead, which should apply cleanly for now

Thanks, applied as a261571.

Bumped the version and unconfused the Changes list in efd435c

Tony

@p5pRT
Copy link
Author

p5pRT commented Nov 28, 2016

@tonycoz - Status changed from 'open' to 'pending release'

@p5pRT
Copy link
Author

p5pRT commented Nov 29, 2016

From @bdraco

Thanks Tony

On Nov 28, 2016, at 1​:50 PM, Tony Cook via RT <perlbug-followup@​perl.org> wrote​:

On Fri, 18 Nov 2016 10​:52​:39 -0800, atoomic wrote​:

Here is the patch rebase on blead, which should apply cleanly for now

Thanks, applied as a261571.

Bumped the version and unconfused the Changes list in efd435c

Tony

@p5pRT
Copy link
Author

p5pRT commented May 30, 2017

From @khwilliamson

Thank you for filing this report. You have helped make Perl better.

With the release today of Perl 5.26.0, this and 210 other issues have been
resolved.

Perl 5.26.0 may be downloaded via​:
https://metacpan.org/release/XSAWYERX/perl-5.26.0

If you find that the problem persists, feel free to reopen this ticket.

@p5pRT
Copy link
Author

p5pRT commented May 30, 2017

@khwilliamson - Status changed from 'pending release' to 'resolved'

@p5pRT p5pRT closed this as completed May 30, 2017
@jkeenan jkeenan added the dist-Data-Dumper issues in the dual-life blead-first Data-Dumper distribution label Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dist-Data-Dumper issues in the dual-life blead-first Data-Dumper distribution
Projects
None yet
Development

No branches or pull requests

2 participants