-
Notifications
You must be signed in to change notification settings - Fork 466
Description
GraphQL Plugin's performance deteriorates significantly with the number of post-types and taxonomies defined in the WordPress.
Reproduce the bug:
- Try to add more than 20-30 post types, with around the same number of taxonomies defined for them.
- Check out the response timing of GraphQL endpoint.
To further add to this issue, even caching does not resolve this performance problem. I've tried with
- Object Caching (Redis)
- MySQL caching(I know I shouldn't have)
- Using a GraphQL caching plugin for WordPress
Screencast for the same:
Query statistics:
| Request Type: | WordPress Homepage | GraphQL Request(just endpoint) | WP-JSON Request(just endpoint) | GraphQL Request(Single Post) | WP-JSON Request(Single Post) |
|---|---|---|---|---|---|
| Timing with default WordPress | 85 ms | 220 ms | 80 ms | 230 ms | 80 ms |
| Timinig with 10 post types and 10 taxonomies | 90 ms | 400 ms | 110 ms | 407 ms | 100 ms |
| Timing with 50 post types and 50 taxonomies | 160 ms | 1650 ms | 260 ms | 1650 ms | 230 ms |
Here's a link to XDebug profiling for the above requests(I've skipped the 10 post type in there)
https://drive.google.com/drive/folders/1-U_8Gb4BsL_UEHMyO0NKthRRkXQmq_2i?usp=sharing
Related info:
What version of WPGraphQL you're using, and the platform(s) you're running it on
WPGraphQL version: 1.3.5
What other plugins you're using
No plugin active on the site except WPGraphQL
The behavior you expect to see, and the actual behavior
The number of post types and taxonomies defined in a WordPress site should have minimal/no impact on the performance of GraphQL queries.
Any website running WooCommerce, has multiple post types defined for things like:
- Orders
- Products
- Variations
- Coupons
having custom taxonomies like:
- Product type
- Product visibility
- Product categories
- Product tags
- Product shipping classes
- Product Color
- Product Design
- Product Material
- Product Size
- Product Style
Once you set this up, and add a few more plugins that adds CPTs and site almost becomes unusable, if built using GraphQL.
When reporting a bug, please be sure to include the following:
- A descriptive title
- An isolated way to reproduce the behavior (example: GitHub repository with code isolated to the issue that anyone can clone to observe the problem)
- What version of
WPGraphQLyou're using, and the platform(s) you're running it on - What other plugins you're using
- The behavior you expect to see, and the actual behavior
