[wp-trac] [WordPress Trac] #40921: Inconsistent Handling of mp4 by Audio Widget

WordPress Trac noreply at wordpress.org
Sun Feb 25 20:12:46 UTC 2018


#40921: Inconsistent Handling of mp4 by Audio Widget
-------------------------------------------------+-------------------------
 Reporter:  toddhalfpenny                        |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  5.0
Component:  Media                                |     Version:  3.6
 Severity:  normal                               |  Resolution:
 Keywords:  2nd-opinion dev-feedback has-        |     Focuses:
  screenshots has-patch needs-unit-tests         |
-------------------------------------------------+-------------------------

Comment (by soulseekah):

 Some simple benchmarks on the test mp4 file by performing 1000 calls to
 `wp_check_filetype_and_ext`:

 Average without patch: 0.006 seconds / call
 Average with patch: 0.015 seconds / call

 So about 230% increase on SSD, PHP 7.2. In the context of a 100ms vanilla
 core load time - 6% per call, vs 15% per call. Quite heavy actually, but
 only if we're checking mp4/ogg files. Calls to `wp_check_filetype_and_ext`
 do not impact performance for other filetypes. Performance is mostly disk-
 latency bound.

 The core never calls it in a loop, only once during upload. And anyone who
 does any sort of looping over mp4/ogg files and detecting en masse is
 asking for trouble anyway.

 Memory usage is minimal, the library, as @mikeschroder mentioned, does
 file stream seeking never loading more into memory more than it needs.
 Filesize does not impact runtimes or memory consumption.

 I think this is a great feature. While the performance costs are non-
 negligible, they are pretty bearable, impacting only upload handling times
 of mp4/ogg files (which is an even smaller drop in the total load time
 since the upload would take tens of seconds for the smallest files).

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


More information about the wp-trac mailing list