[wp-trac] [WordPress Trac] #57375: Add move_dir() function

WordPress Trac noreply at wordpress.org
Thu Jan 19 01:50:35 UTC 2023


#57375: Add move_dir() function
----------------------------+--------------------------
 Reporter:  afragen         |       Owner:  (none)
     Type:  enhancement     |      Status:  new
 Priority:  normal          |   Milestone:  6.2
Component:  Filesystem API  |     Version:  trunk
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |     Focuses:  performance
----------------------------+--------------------------

Comment (by costdev):

 In Chassis, I ran a `microtime()` test between `copy_dir()` and
 `move_dir()` on `plugins/woocommerce`. Both `copy_dir()` and `move_dir()`
 included OPcache invalidation.

 Test 1:
 {{{
 copy_dir(): 18.564819812775
 move_dir(): 2.5664520263672 (86% faster)
 }}}

 Test 2:
 {{{
 copy_dir(): 17.737833023071
 move_dir(): 2.5115830898285 (85% faster)
 }}}

 Test 3:
 {{{
 copy_dir(): 17.455080986023
 move_dir(): 2.4744238853455 (85% faster)
 }}}

 I also tried swapping the order so that `move_dir()` came first, in case
 the first one would always run a bit slower. The results were the same.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57375#comment:32>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list