|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2025-01-18 22:16 UTC] bukka@php.net
-Status: Open
+Status: Not a bug
-Assigned To:
+Assigned To: bukka
[2025-01-18 22:16 UTC] bukka@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 04:00:01 2025 UTC |
Description: ------------ Purpose: move a file from local mount to a GlusterFS mount. File: 16MB XML. Vanilla PHP operation: use `rename()` to move the file. Linux command: shell_exec("mv '$sourcePath' '$targetPath'") Note: My glusterFS mount has a terrible performance at the moment, writes usually around 2MB/s, so it is making a good testing environment for read/write operations. Result: - PHP rename() takes about 56.2257 seconds to move the file. - Linux command via shell_exec takes 15.8680s. The latter takes 3.5433 less time than PHP's rename(). Test script: --------------- $path1 = '/tmp/1220631606.xliff'; $path2 = '/gluster_mount/'.rand(); $start = microtime(true); rename($path1, $path2); $end = microtime(true); echo 'rename time: '.($end-$start).PHP_EOL; $start = microtime(true); shell_exec("mv '".$path1."' '".$path2."'"); $end = microtime(true); echo 'shell_exec time: '.($end-$start).PHP_EOL;