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

perf: Slightly optimise object interner for larger codebase #5170

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

siketyan
Copy link

We have a larger codebase of TypeSpec (total. 17K lines formatted) and found that emitting part is very slow than the compile part, taking 15 seconds avg. on my M3 Pro machine.

After enabling --cpu-prof option of Node.js, I found that intern function is taking larger part of the framegraph. As the JSDoc says, it's not well optimised yet.

This pull request is maybe the first try of the optimisation and slightly improves the execution time of the emitting part. It lowed the execution time from 15 seconds to 6 seconds.

Profiling comparison

← after, before →

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:core Issues for @typespec/compiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants