php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41249 [raw]urldecode memory consumption
Submitted: 2007-05-01 05:57 UTC Modified: 2007-05-01 17:49 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: 3172continuum at gmail dot com Assigned:
Status: Not a bug Package: Performance problem
PHP Version: 5.2.1 OS: w2k
Private report: No CVE-ID: None
 [2007-05-01 05:57 UTC] 3172continuum at gmail dot com
Description:
------------
every call of [raw]urldecode consumes (iirc) like 200 extra bytes of my memory!

if i just delete parts of the array like below, i have a workaround for the next few weeks... this may though not be useful to other users...

i traced it down to this single line which starts with $IMPORT_filepath

Reproduce code:
---------------
//the next line use several extra bytes on each call, why that?????
#$IMPORT_filepath = rawurldecode($res[$i]->path);
$IMPORT_filepath = urldecode($res[$i]->path);
//with this extra line, memory usage gets lowered:
$res[$i] = '';



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-05-01 17:25 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Speed vs Memory situation here. Given most uses of urldecode() extra bit 
of speed is more important then a tiny amount of memory.
 [2007-05-01 17:49 UTC] 3172continuum at gmail dot com
well, its a converter and a sourcefile of more than 800k lines
that would be 160M used in the script just for calling this function 800k times
and its not even recursive or anything like this...
just by calling a function, afterwards more memory is used!??!!

furthermore i dont understand why this isnt a bug :-\
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 09:01:28 2024 UTC