There is no significant difference. Both will use a cached version of the current $post, in one you will access it via global $post, in other via functions that will get the data from the $post in the cache. I would suggest moving the in_the_loop() condition to be first in the IF.
Related Posts:
- what does O(N) mean [duplicate]
- What is the difference between set and hashset in C++ STL?
- When should we use Radix sort?
- What is the best way to profile javascript execution?
- How to parallelize downloads across hostnames on WordPress?
- How to parallelize downloads across hostnames on WordPress?
- Steps to optimize WordPress in regard to server load and website speed?
- How can I debug the TTFB in WP?
- Localized WordPress is much slower?
- W3 Leverage browser caching not working for google pagespeed [closed]
- How many posts can I have in a WordPress website?
- Cache WordPress translations
- Website is slow: advice on optimization
- Can we have a post without a slug?
- Use override_load_textdomain for cache translation and improve performance
- Combine JS and CSS for WordPress admin
- Will removing revisions positively impact database performance?
- Is WordPress fast enough for a heavy traffic project?
- Does a WP site consumes memory resources when there are NO visitors?
- Extremely slow WordPress website with 6000 posts
- Get Y random authors’ ID/Object with more than X number of posts
- What is a reasonable get_num_queries() result?
- Speeding Up Bulk Post Creation – wp_insert_post & update_post_meta
- How to properly insert a stylesheet in wp_head
- Disable Outbound Web Requests
- Hardcoding and WordPress Performance
- Using Multiple Queries of “home_url” vs. Calling a Variable Multiple Times
- What should be disabled to run on an internal network with no access to the Internet?
- Does running WordPress on Nginx do “squat” for its performance?
- The effect of spam comments on hosting resource usage (CPU)
- Could a higher number of registered image sizes affect performance?
- Combining multiple javascript and css files
- How many caching plugins should be used?
- Why can’t /wp-login.php be load balanced?
- Preload external PHP information
- WordPress Scalability – One Instance or Several?
- What Is The Best Method/Tool To Investigate WordPress Internal Performance?
- Do WP_debug notices explain why my site runs so slow?
- WordPress Caching On Demand
- Is there a real benefit in using wordpress optimized hosting?
- What is better to use, user meta, custom taxonomies or new database structure? [closed]
- How to disable Vary cache header on W3Total Cache plugin [closed]
- Point static content like css and js to cookieless subdomain
- upper limit on concurrent editing?
- Native Lazy Loading on Safari
- Page taking time in loading. Also used lazy loading but doesn’t work?
- Identify running process that constantly use 5% CPU
- Debugging high CPU usage during periods of inactivity
- How accurate is P3 Plugin profiler
- WordPress as framework
- Optimise page loading time faster on Genesis child theme [closed]
- Timezone is wrong when picking city (Copenhagen)
- does wordpress serve static files?
- Site loading extremely slowly
- Conditionally include files in functions.php?
- Bandwidth usage increased in WordPress 3.5
- High traffic management in WP
- Remove unused CSS and JS
- How to check performance of WordPress dashboard
- Horrendously slow admin and pretty slow sites [closed]
- Server technical information and first respond time for WordPress
- Avoid loading Facebook buttons and statistics multiple times
- Calling various CSS sheets in header a good idea?
- Using functions repeatedly instead of variables
- WordPress Site Speed (Maybe Server Issue)
- Speed optimization on WP site, Remove query strings from static resources [duplicate]
- Offloading cron jobs
- How do I make content only load on desktop? [duplicate]
- WordPress digitalocean taking forever to load
- Faster Emails with WP Mail
- What could explain an extremely high TTFB (~20-30s) when not logged in, but then drastically reduced when logged in?
- Page flashes/flickers on every page load
- How can I figure out what is making my WordPress site so slow?
- “edit page” not loading
- What can be a solution when my wordpress is extremely slow?
- wp_set_post_terms() seems very slow
- Improve WordPress performance on large number of posts
- licenses, subscriptions, etc and the impact on performance
- WordPress slow even use blank template
- What’s the best way to dequeue / remove uncooperative scripts and styles?
- Is WP-Cron / wp_schedule_event suitable for time-consuming actions?
- wp_get_attachment_image_src() regenerate custom size images everytime
- Using static home page and wordpress only as a blog
- Control load order?
- admin.php taking 14 seconds
- Is there a way to pass google webmaster CLS on WordPress website?
- Site too Slow to establish db connection?
- Site load time increased
- Too many index.php files running and eating up all memory
- WordPress system (hardware) requirements?
- How much server power does Worldpress take? [closed]
- To what degree can use of caching-plugins and a CDN boost WordPress performance? [closed]
- JS/CSS duplicate load and 404 Error [closed]
- How can we remove “unused”/no long used calls when loading the homepage?
- Are networks now faster than disks?
- How can a single disk in a hardware SATA RAID-10 array bring the entire array to a screeching halt?
- High load average, low CPU usage – why?
- Very long initial loading (20sec)
- How can I optimize my website for improved speed? [closed]
- Identifying Issues in Pagespeed Insights: Server Response Time and Long Main Thread Tasks