[wp-trac] [WordPress Trac] #28425: get_permalink passes only post ID to called functions instead of post object
WordPress Trac
noreply at wordpress.org
Wed Jun 25 09:59:42 UTC 2014
#28425: get_permalink passes only post ID to called functions instead of post
object
-------------------------------------------+--------------------------
Reporter: arnee | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 4.0
Component: Posts, Post Types | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch dev-feedback commit | Focuses: performance
-------------------------------------------+--------------------------
Comment (by kovshenin):
I don't see a 15% increase with or without the patch. I ran a
[https://gist.github.com/kovshenin/2bcd348dbc77281d7bc7 few benchmarks]
with 1000 calls to get_permalink() which passes an object vs id to
get_page_link(), I don't see a significant increase or decrease in
performance.
I did run the benchmarks separately too and there's ~ 8,000 extra function
calls when working with the id, most notably wp_cache_get(), is_object(),
and WP_Post::get_instance(). None of them seems to make a significant
difference in execution time.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28425#comment:16>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list