I have a page with content type “blog_post”. I’ve noticed that when a blog_post has a slug set, during page load and when setting the page thing, there’s an additional search being executed which costs extra WU and significantly increases page load speed.
This doesn’t happen when the blog_post doesn’t have a slug and the page thing is set using the blog_post id with fetch type mget. In that case, the URL is /post/{id}.
Looks like this is the same issue @matt.n spotted here https://forum.bubble.io/t/lookup-by-slug-vs-id-the-workload-costs/344362. Unfortunately, I couldn’t find any info on the forum about how to avoid this extra search when using slugs to set the page thing.
Is this behavior correct or is this a bug that’s been causing longer page loads and higher WU for at least a year now?
@matt.n @boston85719 @fede.bubble what do you guys think?
Here are my test results: Each time I did 5 page loads with Google Chrome Console > Cache disabled = true.
1. WITH SLUG
COSTS
Workflow Units per page load total: 1.31 WU
Page Load: 0.67 WU
Fetching Data 0.64 WU:
- Search (x1): 0.52 WU
- Individual Data Request: 0.12 WU
PERFORMANCE
Network tab (Fetch/XHR) logs:
- document: 337 ms
- hi: 271 ms
- start: 516 ms
- client_log: 292 ms
- mget: 318 ms
- m: 259 ms
Logs related with blog_post search:
- msearch blog_post: 404 ms
- bulk_watch: 312 ms
Average LCP: 2.72 s (Above 2.5s means page load speed needs improvement for Google
)
2. WITH ID
COSTS
Workflow Units per page load: 0.45 WU (less by 0.86 WU - 66% cheaper
)
Page Load: 0.37 (less by 0.3 WU)
Fetching Data 0.08:
- Search: 0 WU
- Individual Data Request: 0.08 WU
PERFORMANCE
Network tab (Fetch/XHR) logs:
- document: 565 ms
- hi: 372 ms
- start: 508 ms
- client_log: 387 ms
- mget: 362 ms
- m: 268 ms
Logs related with blog_post search:
- msearch blog_post: 0 ms
- bulk_watch: 0 ms
Average LCP: 2.0 s (less by 0.72s - 25%). Below 2.5s means page load speed is Good for Google.



