microsoft / microsoft/TypeScript

Cache `getExePath()` for performance reasons

Open
#63,801 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Possible Improvement
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

Would it be possible to have getExePath() cache its result so we don't have to do all this lookup every time tsgo is invoked? The platform and arch rarely changes once installed on disk.

In one of the repositories I'm maintaining, we've inlined what tsgo.js does and added caching on top of it. We're not a very big monorepo, but this shaved off several seconds for us.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in tsgo.js by locating getExePath() and tracing how often it runs when tsgo is invoked. Check the existing lookup behavior across platforms and architectures, then confirm that caching preserves the selected executable while avoiding repeated lookups. Done means repeated invocations no longer redo the lookup and the existing behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli, performance, tooling
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.