-
-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Changed require() on sentry to boot faster
#25742
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
Conversation
|
You have run out of free Bugbot PR reviews for this billing cycle. This will reset on January 3. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |
WalkthroughThe top-level Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
📜 Recent review detailsConfiguration used: Repository UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (2)📓 Common learnings📚 Learning: 2025-08-11T19:39:00.428ZApplied to files:
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
8e6135d to
286b803
Compare
ref https://linear.app/ghost/issue/BER-3132 - The `require('@tryghost/errors')` adds 50-100ms on boot time, this is due to the package's own initialization and `require()`. Since it's not needed at boot, it can be moved inside the `beforeSend` function.
286b803 to
ea35d84
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
Approved 👍 Out of interest, is there anything we can do in @tryghost/errors to improve that packages performance across the board? |
|
IIRC, Claude mentioned: https://github.com/TryGhost/framework/blob/main/packages/errors/src/utils.ts#L1 as the culprit. |
|
In that case, would it be preferable to do the same delayed require in that package so we only pay the cost on the first stack trace generation? |
|
I'd say so. I wanted to address the boot time on Ghost, but probably makes sense to get the package changed with what you suggested. |
ref https://linear.app/ghost/issue/BER-3132
require('@tryghost/errors')adds 50-100ms on boot time, this is due to the package's own initialization andrequire(). Since it's not needed at boot, it can be moved inside thebeforeSendfunction.