ID:               29922
 User updated by:  info at pion dot xs4all dot nl
 Reported By:      info at pion dot xs4all dot nl
 Status:           Open
 Bug Type:         *Directory/Filesystem functions
 Operating System: Linux
-PHP Version:      Irrelevant
+PHP Version:      5.0.1
 New Comment:

- The observation was on rhel 3 with php 4.3.2
- The test in the report was done on a FC1 system with php 4.3.3
- Now i have checked php 4.3.8 on fc2 (the default php) and php 5.0.1

Al have the same result although the speed diferences on the
fc2 system are smaller. This could be caused by different
hardware or differences in the linux vm (2.4.X versus 2.6.X)


Previous Comments:
------------------------------------------------------------------------

[2004-08-31 19:07:04] info at pion dot xs4all dot nl

Description:
------------
If you copy a file of N megabytes (N in the order of a few
hundred megs) your proces will use the same order of ammount
of memory (or less if the system doesn't have that much).

This is probably because the file is compleetly memory mapped
and than the content is written to an other file.

Probably it will be better to use the behavior of the unix
"cp" command which reads 4k and than writes the 4k.

In this way "cp" is almost a factor two faster than php
and has less impact on the system performance.

Reproduce code:
---------------
<?php
#
# This assumes that there excist a big
# file "/tmp/file_512m" which has 512mb
# of data and that there is enough space
# in "/tmp".
#
  copy ("/tmp/file_512m", "/tmp/target")
?>

Expected result:
----------------
The unix "cp" needed 1 minut 8 seconds to copy
the file and php used 2 and 18 seconds on my desktop
system with 512mb.

Actual result:
--------------
They should be in the same order


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=29922&edit=1

Reply via email to