|
12 | 12 | * @return array Benchmark data for WP_Query by ID. |
13 | 13 | */ |
14 | 14 | function benchpress_benchmark_wp_query_by_id() { |
15 | | - // Retrieve settings |
16 | | - $query_type = get_option( 'benchpress_query_type', 'single' ); |
17 | | - $post_id = get_option( 'benchpress_post_id', [] ); |
18 | | - $post_type = get_option( 'benchpress_post_type', 'post' ); |
19 | | - $post_count = get_option( 'benchpress_post_count', 5 ); |
20 | | - $taxonomy = get_option( 'benchpress_taxonomy', '' ); |
21 | | - $tax_terms = get_option( 'benchpress_tax_terms', '' ); |
22 | | - $orderby = get_option( 'benchpress_orderby', 'date' ); |
23 | | - $order = get_option( 'benchpress_order', 'ASC' ); |
24 | | - $iterations = get_option( 'benchpress_query_iterations', 1 ); |
| 15 | + // Retrieve settings. |
| 16 | + $query_type = get_option( 'benchpress_query_type', 'single' ); |
| 17 | + $post_id = get_option( 'benchpress_post_id', [] ); |
| 18 | + $post_type = get_option( 'benchpress_post_type', 'post' ); |
| 19 | + $post_count = get_option( 'benchpress_post_count', 5 ); |
| 20 | + $taxonomy = get_option( 'benchpress_taxonomy', '' ); |
| 21 | + $tax_terms = get_option( 'benchpress_tax_terms', '' ); |
| 22 | + $orderby = get_option( 'benchpress_orderby', 'date' ); |
| 23 | + $order = get_option( 'benchpress_order', 'ASC' ); |
| 24 | + $iterations = get_option( 'benchpress_query_iterations', 1 ); |
25 | 25 |
|
26 | 26 | $args = [ |
27 | 27 | 'post_type' => $post_type, |
@@ -90,7 +90,7 @@ function benchpress_benchmark_wp_query_by_id() { |
90 | 90 | /** |
91 | 91 | * Benchmark Array Merge Methods. |
92 | 92 | * |
93 | | - * @since 1.0.0 |
| 93 | + * @since 1.0.0 |
94 | 94 | * @return array Benchmark data for array merge. |
95 | 95 | */ |
96 | 96 | function benchpress_benchmark_array_merge() { |
@@ -226,10 +226,10 @@ function benchpress_benchmark_transient_vs_direct_query() { |
226 | 226 | $loop_count |
227 | 227 | ); |
228 | 228 |
|
229 | | - // Measure execution time for direct query.. |
| 229 | + // Measure execution time for direct query. |
230 | 230 | $start_direct = microtime( true ); |
231 | 231 | $wpdb->get_results( $query ); |
232 | | - $end_direct = microtime( true ); |
| 232 | + $end_direct = microtime( true ); |
233 | 233 | $direct_query_time = $end_direct - $start_direct; |
234 | 234 |
|
235 | 235 | // Measure execution time for transient caching. |
|
0 commit comments