Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

refactor(experimental): alias JSON-RPC types for performance #1760

Conversation

steveluscher
Copy link
Contributor

@steveluscher steveluscher commented Oct 22, 2023

Summary

tl;dr, @Dimava is a saint (link).

Breaking up the mega-overload helper into separate helpers for each level of overload fixed #1682.

Test Plan

~/src/solana-web3.js-git$ cd pacakges/library/
~/src/solana-web3.js-git/packages/library$ pnpm tsc -p ./tsconfig.json --noEmit --generateTrace tracing_output_folder
# open resulting trace in chrome://tracing

Before (11300ms check time)

image

After (170ms check time)

image

Holy shit.

Screen.Recording.2023-10-21.at.11.08.12.PM.mov

@steveluscher
Copy link
Contributor Author

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@steveluscher steveluscher merged commit ba9b4c7 into master Oct 22, 2023
@steveluscher steveluscher deleted the 10-22-refactor_experimental_alias_JSON-RPC_types_for_performance branch October 22, 2023 06:09
@nmn
Copy link

nmn commented Oct 25, 2023

Interesting. The main optimisation seems to breaking up the giant Overloads type into separate type definitions. Perhaps Typescript is able to better optimise lots of small types instead of a giant type.

I wouldn't have even tried this.

@steveluscher
Copy link
Contributor Author

I wouldn't have even tried this.

That's actually my only contribution to this industry.

@github-actions
Copy link
Contributor

🎉 This PR is included in version 1.87.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link
Contributor

Because there has been no activity on this PR for 14 days since it was merged, it has been automatically locked. Please open a new issue if it requires a follow up.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[experimental] Speed up Typescript without reducing overloads in json-rpc-types
2 participants