-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Simply create a new file when calling updateFile
#3154
base: v2
Are you sure you want to change the base?
Conversation
Previously the code used TypeScript's `updateFile`, which performs an incremental parse; however, if we don't expect the contents to be similar enough, this wastes a lot of work. Reuse should still done for untouched files from old versions of the program.
62baafa
to
db7b005
Compare
I don't see the same results in CI, and apparently it was right for me to call out that "big if!" - switching back to the v2 branch, running |
Yeah, locally on rebuild, things are cached. If you're profiling, you kinda want to clean everything and rebuild from scratch to get the "true" time spent in CI. |
type System = import("typescript").System | ||
type CompilerOptions = import("typescript").CompilerOptions | ||
type CustomTransformers = import("typescript").CustomTransformers | ||
type LanguageServiceHost = import("typescript").LanguageServiceHost | ||
type CompilerHost = import("typescript").CompilerHost | ||
type SourceFile = import("typescript").SourceFile | ||
type TS = typeof import("typescript") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this required to make the fix?
What are your performance results from? This is a public package that (I guess) we encourage people to use for all kinds of stuff. My guess is that most instances of |
This was actually from |
Are we calling |
Previously the code used TypeScript's
updateFile
, which performs an incremental parse; however, if we don't expect the contents to be similar enough, this wastes a lot of work. Reuse should still be done for untouched files from old versions of the program.If I measured correctly (big if!), the before is something like this:
And the after (with this PR) looks like this:
I did run a
clean
in between steps, so hopefully I did everything correctly - but this is a pretty nice drop!