Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the module seems to add significant overhead to unrelated parts of the app #213

Open
warflash opened this issue Jun 1, 2024 · 2 comments

Comments

@warflash
Copy link

warflash commented Jun 1, 2024

I noticed our API response times increased significantly when using the og-image module.
On our production instance the difference goes from around ~40ms avg to ~110ms avg depending on whether the module is on or off.

I feel it's difficult to share a proper reproduction, but the perf difference forces us to disable the module entirely

@warflash
Copy link
Author

warflash commented Jun 2, 2024

So I investigated further and attached flamegraphs below. It seems like https://github.com/harlan-zw/nuxt-schema-org is also affected by this. With both of them disabled everything runs as expected.

I ran a flamegraph perf test of the node server and those are the results for with the 2 modules:
Flamegraph download: with-og-schema.cpuprofile
image

Both modules disabled:
Download: no-og-schema.cpuprofile
image

Something about the way the modules use runtime config seems to add a flat 60ms processing time to every route ever visited

@harlan-zw
Copy link
Collaborator

Hi @warflash, sorry for the delay on this.

I did an initial investigation and couldn't see anything wrong within the module code. This seems to be related to useRuntimeConfig() not using the cached result between calls, an upstream issue with Nitro.

Could you confirm the Nitro and OG Image versions you're using if it's still an issue for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants