-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Optimize extendShape
#4150
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
Optimize extendShape
#4150
Conversation
WalkthroughThe changes update two TypeScript utility types, Changes
Poem
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🔇 Additional comments (4)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
✅ Deploy Preview for guileless-rolypoly-866f8a ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
btw @Andarist, I think this may have already been optimised in Zod 4: |
Co-authored-by: Anders Hejlsberg <andersh@microsoft.com>
e6017b0
to
6a4fdfc
Compare
Given how popular v3 is, I think it still would be good to backport this but, of course, it's up to @colinhacks |
Just when I thought I'd tried every conceivable implementation of ExtendShape Anders drops this fast-path approach. Glorious. |
Benchmarks. This builds the somewhat adversarial script in this gist — a chain of
Zod 3.24.2 (pre-change)
Zod 3.24.3 (post-change)
|
How did emit time end up shrinking? |
@jakebailey |
It has been proposed here and, in fact, it cuts
AnswerOverflow/apps/dashboard
's instantiations from 13672403 to 3538464 (74% reduction) and check time from 6.5s to 4s (38% reduction).Summary by CodeRabbit