[wp-trac] [WordPress Trac] #62124: wp_parse_url() - code update for performance and removal of now unnecessary code fix
WordPress Trac
noreply at wordpress.org
Thu Nov 7 13:07:20 UTC 2024
#62124: wp_parse_url() - code update for performance and removal of now unnecessary
code fix
--------------------------------------+------------------------------
Reporter: wpseeddoctor | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: HTTP API | Version: trunk
Severity: trivial | Resolution:
Keywords: has-patch has-unit-tests | Focuses: performance
--------------------------------------+------------------------------
Comment (by pbearne):
Replying to [comment:4 wpseeddoctor]:
> Hi,
> here is the pull request: https://github.com/WordPress/wordpress-
develop/pull/7743
> Replying to [comment:2 pbearne]:
> > @wpseeddoctor can you please create a pull request for this code?
> > So we can see if the tests run OK
Thank you
There are few whitespace issues https://github.com/WordPress/wordpress-
develop/pull/7743/files that it would great if you can fix
the good news is nothing has broken
Performance Test Results
All numbers are median values over 2 repetitions with 20 iterations each.
Note: Due to the nature of how GitHub Actions work, some variance in the
results is expected.
Admin › Locale: en_US
┌─────────┬───────────────────┬────────────┬────────────┬───────────┬──────────┬─────────────────────┬───────────┐
│ (index) │ Metric │ Before │ After │ Diff abs. │ Diff
% │ STD │ MAD │
├─────────┼───────────────────┼────────────┼────────────┼───────────┼──────────┼─────────────────────┼───────────┤
│ 0 │ 'timeToFirstByte' │ '28.90 ms' │ '29.00 ms' │ '0.10 ms' │
'0.34 %' │ '1.32 ms' │ '0.70 ms' │
│ 1 │ 'wpTotal' │ '26.02 ms' │ '26.33 ms' │ '0.30 ms' │
'1.16 %' │ '1.26 ms' │ '0.63 ms' │
│ 2 │ 'wpMemoryUsage' │ '3.57 MB' │ '3.57 MB' │ '0.00 MB' │
'0.01 %' │ '0.00 MB' │ '0.00 MB' │
│ 3 │ 'wpDbQueries' │ 2 │ 2 │ 0 │
'0.00 %' │ 0.31224989991991986 │ 0 │
│ 4 │ 'wpExtObjCache' │ 'yes' │ 'yes' │ '' │ ''
│ '' │ '' │
└─────────┴───────────────────┴────────────┴────────────┴───────────┴──────────┴─────────────────────┴───────────┘
Admin › Locale: de_DE
┌─────────┬───────────────────┬────────────┬────────────┬────────────┬───────────┬─────────────────────┬───────────┐
│ (index) │ Metric │ Before │ After │ Diff abs. │
Diff % │ STD │ MAD │
├─────────┼───────────────────┼────────────┼────────────┼────────────┼───────────┼─────────────────────┼───────────┤
│ 0 │ 'timeToFirstByte' │ '33.95 ms' │ '32.00 ms' │ '-1.95 ms' │
'-6.09 %' │ '8.80 ms' │ '1.00 ms' │
│ 1 │ 'wpTotal' │ '28.63 ms' │ '28.50 ms' │ '-0.13 ms' │
'-0.46 %' │ '6.75 ms' │ '1.88 ms' │
│ 2 │ 'wpMemoryUsage' │ '3.84 MB' │ '3.84 MB' │ '0.00 MB' │
'0.06 %' │ '0.27 MB' │ '0.27 MB' │
│ 3 │ 'wpDbQueries' │ 2 │ 2 │ 0 │
'0.00 %' │ 0.22220486043288945 │ 0 │
│ 4 │ 'wpExtObjCache' │ 'yes' │ 'yes' │ '' │ ''
│ '' │ '' │
└─────────┴───────────────────┴────────────┴────────────┴────────────┴───────────┴─────────────────────┴───────────┘
Front End › Theme: twentytwentyone, Locale: en_US
┌─────────┬──────────────────────────┬─────────────┬─────────────┬────────────┬───────────┬───────────┬───────────┐
│ (index) │ Metric │ Before │ After │ Diff
abs. │ Diff % │ STD │ MAD │
├─────────┼──────────────────────────┼─────────────┼─────────────┼────────────┼───────────┼───────────┼───────────┤
│ 0 │ 'timeToFirstByte' │ '41.65 ms' │ '42.60 ms' │ '0.95
ms' │ '2.23 %' │ '3.29 ms' │ '1.65 ms' │
│ 1 │ 'largestContentfulPaint' │ '129.00 ms' │ '127.65 ms' │ '-1.35
ms' │ '-1.06 %' │ '9.42 ms' │ '4.65 ms' │
│ 2 │ 'lcpMinusTtfb' │ '85.40 ms' │ '84.35 ms' │ '-1.05
ms' │ '-1.24 %' │ '7.32 ms' │ '3.90 ms' │
│ 3 │ 'wpBeforeTemplate' │ '11.25 ms' │ '11.44 ms' │ '0.19
ms' │ '1.66 %' │ '1.41 ms' │ '0.93 ms' │
│ 4 │ 'wpTemplate' │ '27.52 ms' │ '27.46 ms' │ '-0.06
ms' │ '-0.24 %' │ '2.60 ms' │ '0.65 ms' │
│ 5 │ 'wpTotal' │ '38.91 ms' │ '39.73 ms' │ '0.81
ms' │ '2.05 %' │ '3.22 ms' │ '1.47 ms' │
│ 6 │ 'wpMemoryUsage' │ '3.52 MB' │ '3.52 MB' │ '0.00
MB' │ '0.01 %' │ '0.02 MB' │ '0.00 MB' │
│ 7 │ 'wpDbQueries' │ 0 │ 0 │ ''
│ '' │ '' │ '' │
│ 8 │ 'wpExtObjCache' │ 'yes' │ 'yes' │ ''
│ '' │ '' │ '' │
└─────────┴──────────────────────────┴─────────────┴─────────────┴────────────┴───────────┴───────────┴───────────┘
Front End › Theme: twentytwentyone, Locale: de_DE
┌─────────┬──────────────────────────┬─────────────┬─────────────┬────────────┬───────────┬───────────┬───────────┐
│ (index) │ Metric │ Before │ After │ Diff
abs. │ Diff % │ STD │ MAD │
├─────────┼──────────────────────────┼─────────────┼─────────────┼────────────┼───────────┼───────────┼───────────┤
│ 0 │ 'timeToFirstByte' │ '42.80 ms' │ '42.65 ms' │ '-0.15
ms' │ '-0.35 %' │ '1.50 ms' │ '0.75 ms' │
│ 1 │ 'largestContentfulPaint' │ '130.25 ms' │ '129.15 ms' │ '-1.10
ms' │ '-0.85 %' │ '7.09 ms' │ '3.80 ms' │
│ 2 │ 'lcpMinusTtfb' │ '86.10 ms' │ '86.60 ms' │ '0.50
ms' │ '0.58 %' │ '6.98 ms' │ '4.25 ms' │
│ 3 │ 'wpBeforeTemplate' │ '12.03 ms' │ '12.04 ms' │ '0.01
ms' │ '0.04 %' │ '1.36 ms' │ '1.04 ms' │
│ 4 │ 'wpTemplate' │ '27.58 ms' │ '27.51 ms' │ '-0.07
ms' │ '-0.27 %' │ '1.94 ms' │ '0.52 ms' │
│ 5 │ 'wpTotal' │ '39.81 ms' │ '39.91 ms' │ '0.10
ms' │ '0.25 %' │ '2.50 ms' │ '1.26 ms' │
│ 6 │ 'wpMemoryUsage' │ '3.72 MB' │ '3.75 MB' │ '0.04
MB' │ '0.96 %' │ '0.17 MB' │ '0.11 MB' │
│ 7 │ 'wpDbQueries' │ 0 │ 0 │ ''
│ '' │ '' │ '' │
│ 8 │ 'wpExtObjCache' │ 'yes' │ 'yes' │ ''
│ '' │ '' │ '' │
└─────────┴──────────────────────────┴─────────────┴─────────────┴────────────┴───────────┴───────────┴───────────┘
Front End › Theme: twentytwentythree, Locale: en_US
┌─────────┬──────────────────────────┬─────────────┬─────────────┬────────────┬───────────┬───────────┬───────────┐
│ (index) │ Metric │ Before │ After │ Diff
abs. │ Diff % │ STD │ MAD │
├─────────┼──────────────────────────┼─────────────┼─────────────┼────────────┼───────────┼───────────┼───────────┤
│ 0 │ 'timeToFirstByte' │ '50.00 ms' │ '50.20 ms' │ '0.20
ms' │ '0.40 %' │ '2.56 ms' │ '0.85 ms' │
│ 1 │ 'largestContentfulPaint' │ '124.00 ms' │ '124.60 ms' │ '0.60
ms' │ '0.48 %' │ '5.19 ms' │ '2.85 ms' │
│ 2 │ 'lcpMinusTtfb' │ '72.65 ms' │ '73.05 ms' │ '0.40
ms' │ '0.55 %' │ '3.88 ms' │ '1.85 ms' │
│ 3 │ 'wpBeforeTemplate' │ '13.37 ms' │ '13.64 ms' │ '0.27
ms' │ '1.98 %' │ '2.27 ms' │ '1.79 ms' │
│ 4 │ 'wpTemplate' │ '28.07 ms' │ '28.16 ms' │ '0.09
ms' │ '0.34 %' │ '2.90 ms' │ '1.36 ms' │
│ 5 │ 'wpTotal' │ '41.84 ms' │ '41.36 ms' │ '-0.49
ms' │ '-1.18 %' │ '4.61 ms' │ '2.71 ms' │
│ 6 │ 'wpMemoryUsage' │ '3.86 MB' │ '3.86 MB' │ '0.00
MB' │ '0.01 %' │ '0.38 MB' │ '0.35 MB' │
│ 7 │ 'wpDbQueries' │ 0 │ 0 │ ''
│ '' │ '' │ '' │
│ 8 │ 'wpExtObjCache' │ 'yes' │ 'yes' │ ''
│ '' │ '' │ '' │
└─────────┴──────────────────────────┴─────────────┴─────────────┴────────────┴───────────┴───────────┴───────────┘
Front End › Theme: twentytwentythree, Locale: de_DE
┌─────────┬──────────────────────────┬─────────────┬─────────────┬────────────┬───────────┬───────────┬───────────┐
│ (index) │ Metric │ Before │ After │ Diff
abs. │ Diff % │ STD │ MAD │
├─────────┼──────────────────────────┼─────────────┼─────────────┼────────────┼───────────┼───────────┼───────────┤
│ 0 │ 'timeToFirstByte' │ '51.75 ms' │ '52.00 ms' │ '0.25
ms' │ '0.48 %' │ '2.43 ms' │ '1.15 ms' │
│ 1 │ 'largestContentfulPaint' │ '127.25 ms' │ '125.00 ms' │ '-2.25
ms' │ '-1.80 %' │ '4.24 ms' │ '2.80 ms' │
│ 2 │ 'lcpMinusTtfb' │ '74.10 ms' │ '72.55 ms' │ '-1.55
ms' │ '-2.14 %' │ '4.02 ms' │ '1.65 ms' │
│ 3 │ 'wpBeforeTemplate' │ '14.73 ms' │ '14.57 ms' │ '-0.16
ms' │ '-1.10 %' │ '2.71 ms' │ '2.13 ms' │
│ 4 │ 'wpTemplate' │ '31.27 ms' │ '31.18 ms' │ '-0.09
ms' │ '-0.27 %' │ '2.92 ms' │ '2.36 ms' │
│ 5 │ 'wpTotal' │ '46.53 ms' │ '46.44 ms' │ '-0.10
ms' │ '-0.22 %' │ '5.16 ms' │ '4.78 ms' │
│ 6 │ 'wpMemoryUsage' │ '4.14 MB' │ '4.14 MB' │ '0.00
MB' │ '0.00 %' │ '0.51 MB' │ '0.44 MB' │
│ 7 │ 'wpDbQueries' │ 0 │ 0 │ ''
│ '' │ '' │ '' │
│ 8 │ 'wpExtObjCache' │ 'yes' │ 'yes' │ ''
│ '' │ '' │ '' │
└─────────┴──────────────────────────┴─────────────┴─────────────┴────────────┴───────────┴───────────┴───────────┘
Front End › Theme: twentytwentyfour, Locale: en_US
┌─────────┬──────────────────────────┬─────────────┬─────────────┬────────────┬───────────┬────────────┬───────────┐
│ (index) │ Metric │ Before │ After │ Diff
abs. │ Diff % │ STD │ MAD │
├─────────┼──────────────────────────┼─────────────┼─────────────┼────────────┼───────────┼────────────┼───────────┤
│ 0 │ 'timeToFirstByte' │ '77.95 ms' │ '78.40 ms' │ '0.45
ms' │ '0.57 %' │ '2.50 ms' │ '1.30 ms' │
│ 1 │ 'largestContentfulPaint' │ '201.45 ms' │ '200.30 ms' │ '-1.15
ms' │ '-0.57 %' │ '9.32 ms' │ '3.20 ms' │
│ 2 │ 'lcpMinusTtfb' │ '122.55 ms' │ '122.35 ms' │ '-0.20
ms' │ '-0.16 %' │ '8.15 ms' │ '3.05 ms' │
│ 3 │ 'wpBeforeTemplate' │ '14.98 ms' │ '15.11 ms' │ '0.13
ms' │ '0.86 %' │ '2.64 ms' │ '1.80 ms' │
│ 4 │ 'wpTemplate' │ '31.75 ms' │ '31.88 ms' │ '0.13
ms' │ '0.41 %' │ '12.11 ms' │ '3.89 ms' │
│ 5 │ 'wpTotal' │ '47.59 ms' │ '47.52 ms' │ '-0.06
ms' │ '-0.14 %' │ '13.38 ms' │ '6.43 ms' │
│ 6 │ 'wpMemoryUsage' │ '4.42 MB' │ '4.42 MB' │ '0.00
MB' │ '0.01 %' │ '0.48 MB' │ '0.41 MB' │
│ 7 │ 'wpDbQueries' │ 0 │ 0 │ ''
│ '' │ '' │ '' │
│ 8 │ 'wpExtObjCache' │ 'yes' │ 'yes' │ ''
│ '' │ '' │ '' │
└─────────┴──────────────────────────┴─────────────┴─────────────┴────────────┴───────────┴────────────┴───────────┘
Front End › Theme: twentytwentyfour, Locale: de_DE
┌─────────┬──────────────────────────┬─────────────┬─────────────┬────────────┬───────────┬────────────┬───────────┐
│ (index) │ Metric │ Before │ After │ Diff
abs. │ Diff % │ STD │ MAD │
├─────────┼──────────────────────────┼─────────────┼─────────────┼────────────┼───────────┼────────────┼───────────┤
│ 0 │ 'timeToFirstByte' │ '81.00 ms' │ '80.20 ms' │ '-0.80
ms' │ '-1.00 %' │ '2.14 ms' │ '1.35 ms' │
│ 1 │ 'largestContentfulPaint' │ '203.90 ms' │ '205.35 ms' │ '1.45
ms' │ '0.71 %' │ '5.40 ms' │ '3.70 ms' │
│ 2 │ 'lcpMinusTtfb' │ '123.15 ms' │ '125.00 ms' │ '1.85
ms' │ '1.48 %' │ '5.06 ms' │ '3.95 ms' │
│ 3 │ 'wpBeforeTemplate' │ '15.52 ms' │ '15.70 ms' │ '0.18
ms' │ '1.12 %' │ '2.75 ms' │ '1.83 ms' │
│ 4 │ 'wpTemplate' │ '32.18 ms' │ '32.34 ms' │ '0.16
ms' │ '0.51 %' │ '14.26 ms' │ '4.88 ms' │
│ 5 │ 'wpTotal' │ '48.65 ms' │ '49.03 ms' │ '0.38
ms' │ '0.79 %' │ '15.84 ms' │ '9.28 ms' │
│ 6 │ 'wpMemoryUsage' │ '4.54 MB' │ '4.55 MB' │ '0.01
MB' │ '0.13 %' │ '0.51 MB' │ '0.34 MB' │
│ 7 │ 'wpDbQueries' │ 0 │ 0 │ ''
│ '' │ '' │ '' │
│ 8 │ 'wpExtObjCache' │ 'yes' │ 'yes' │ ''
│ '' │ '' │ '' │
└─────────┴──────────────────────────┴─────────────┴─────────────┴────────────┴───────────┴────────────┴───────────┘
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62124#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list