Skip Menu |
 

This queue is for tickets about the URI CPAN distribution.

Report information
The Basics
Id: 39746
Status: rejected
Priority: 0/
Queue: URI

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

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



Subject: Microoptimization: path_segments
MIME-Version: 1.0
X-Mailer: MIME-tools 5.426 (Entity 5.426)
Charset: utf8
X-RT-Original-Encoding: utf-8
Content-Type: multipart/mixed; boundary="----------=_1222883351-2190-8"
Content-Length: 0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
Content-Length: 184
Download (untitled) / with headers
text/plain 184b
I think the attached patch might make URI::_generic::path_segments faster in set mode (especially in void contexts) and has hopefully no speed penalty in get mode. Regards, Slaven
Subject: URI-pathcomponents.patch
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----------=_1222883351-2190-7"
X-Mailer: MIME-tools 5.426 (Entity 5.426)
Charset: utf8
Content-Length: 0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: iso-8859-1
Content-Length: 0
Content-Type: text/x-patch; name="URI-pathcomponents.patch"
Content-Disposition: inline; filename="URI-pathcomponents.patch"
Content-Transfer-Encoding: binary
Content-Length: 2535
# # # To apply this patch: # STEP 1: Chdir to the source directory. # STEP 2: Run the 'applypatch' program with this patch file as input. # # If you do not have 'applypatch', it is part of the 'makepatch' package # that you can fetch from the Comprehensive Perl Archive Network: # http://www.perl.com/CPAN/authors/Johan_Vromans/makepatch-x.y.tar.gz # In the above URL, 'x' should be 2 or higher. # # To apply this patch without the use of 'applypatch': # STEP 1: Chdir to the source directory. # STEP 2: Run the 'patch' program with this file as input. # #### End of Preamble #### #### Patch data follows #### diff -up 'URI-1.37-FCXd0N/URI/_generic.pm' 'new.URI-1.37/URI/_generic.pm' Index: ./URI/_generic.pm --- ./URI/_generic.pm Thu Apr 3 00:00:02 2008 +++ ./URI/_generic.pm Wed Oct 1 19:42:45 2008 @@ -89,7 +89,6 @@ sub _check_path sub path_segments { my $self = shift; - my $path = $self->path; if (@_) { my @arg = @_; # make a copy for (@arg) { @@ -106,6 +105,8 @@ sub path_segments } $self->path(join("/", @arg)); } + return if !defined wantarray; + my $path = $self->path; return $path unless wantarray; map {/;/ ? $self->_split_segment($_) : uri_unescape($_) } #### End of Patch data #### #### ApplyPatch data follows #### # Data version : 1.0 # Date generated : Wed Oct 1 19:46:41 2008 # Generated by : makepatch 2.00_12* # Recurse directories : Yes # Excluded files : (\A|/).*\~\Z # (\A|/).*\.a\Z # (\A|/).*\.bak\Z # (\A|/).*\.BAK\Z # (\A|/).*\.elc\Z # (\A|/).*\.exe\Z # (\A|/).*\.gz\Z # (\A|/).*\.ln\Z # (\A|/).*\.o\Z # (\A|/).*\.obj\Z # (\A|/).*\.olb\Z # (\A|/).*\.old\Z # (\A|/).*\.orig\Z # (\A|/).*\.rej\Z # (\A|/).*\.so\Z # (\A|/).*\.Z\Z # (\A|/)\.del\-.*\Z # (\A|/)\.make\.state\Z # (\A|/)\.nse_depinfo\Z # (\A|/)core\Z # (\A|/)tags\Z # (\A|/)TAGS\Z # p 'URI/_generic.pm' 5674 1222882965 0100644 #### End of ApplyPatch data #### #### End of Patch kit [created: Wed Oct 1 19:46:41 2008] #### #### Patch checksum: 55 1877 48834 #### #### Checksum: 73 2501 34842 ####
MIME-Version: 1.0
X-Mailer: MIME-tools 5.426 (Entity 5.426)
Content-Disposition: inline
Charset: utf8
Message-Id: <rt-3.6.HEAD-2159-1222890591-1518.39746-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Content-Transfer-Encoding: binary
From: daniel.frett [...] ccci.org
X-RT-Original-Encoding: utf-8
Content-Length: 496
Download (untitled) / with headers
text/plain 496b
On Wed Oct 01 13:49:17 2008, SREZIC wrote: Show quoted text
> I think the attached patch might make URI::_generic::path_segments > faster in set mode (especially in void contexts) and has hopefully no > speed penalty in get mode. > > Regards, > Slaven
This optimization of path_segments will change the return behavior of the method when setting a path. before the patch path_segments will return the path before being updated after the patch path_segments will return the path after being updated -Daniel
MIME-Version: 1.0
X-Mailer: MIME-tools 5.426 (Entity 5.426)
Content-Disposition: inline
Charset: utf8
Message-Id: <rt-3.6.HEAD-2159-1222892087-1684.39746-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 46
Alas, forget this ticket! Regards, Slaven


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.