Skip to content

Conversation

jakebailey
Copy link
Member

@jakebailey jakebailey commented Mar 3, 2025

This is a very good binder win.

goos: linux
goarch: amd64
pkg: github.com/microsoft/typescript-go/internal/binder
cpu: Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz
                                                     │   old.txt    │               new.txt                │
                                                     │    sec/op    │    sec/op     vs base                │
Bind/empty.ts-20                                       417.6n ± 25%   280.0n ± 21%  -32.94% (p=0.000 n=10)
Bind/checker.ts-20                                     18.46m ±  4%   17.22m ±  1%   -6.74% (p=0.000 n=10)
Bind/dom.generated.d.ts-20                             7.713m ±  3%   7.440m ±  2%   -3.54% (p=0.002 n=10)
Bind/Herebyfile.mjs-20                                 307.5µ ±  2%   302.0µ ±  4%        ~ (p=0.353 n=10)
Bind/jsxComplexSignatureHasApplicabilityError.tsx-20   156.6µ ±  4%   153.1µ ±  3%   -2.24% (p=0.043 n=10)
geomean                                                310.0µ         277.9µ        -10.35%
                                                     │   old.txt    │               new.txt                │
                                                     │     B/op     │     B/op      vs base                │
Bind/empty.ts-20                                         432.0 ± 0%     192.0 ± 0%  -55.56% (p=0.000 n=10)
Bind/checker.ts-20                                     7.206Mi ± 0%   7.206Mi ± 0%   -0.00% (p=0.000 n=10)
Bind/dom.generated.d.ts-20                             4.873Mi ± 0%   4.873Mi ± 0%   -0.01% (p=0.000 n=10)
Bind/Herebyfile.mjs-20                                 174.2Ki ± 0%   173.8Ki ± 0%   -0.21% (p=0.000 n=10)
Bind/jsxComplexSignatureHasApplicabilityError.tsx-20   114.8Ki ± 0%   114.4Ki ± 0%   -0.31% (p=0.000 n=10)
geomean                                                198.8Ki        168.9Ki       -15.06%
                                                     │   old.txt   │               new.txt               │
                                                     │  allocs/op  │  allocs/op   vs base                │
Bind/empty.ts-20                                        3.000 ± 0%    2.000 ± 0%  -33.33% (p=0.000 n=10)
Bind/checker.ts-20                                     13.69k ± 0%   13.69k ± 0%   -0.01% (p=0.000 n=10)
Bind/dom.generated.d.ts-20                             14.68k ± 0%   14.68k ± 0%   -0.01% (p=0.000 n=10)
Bind/Herebyfile.mjs-20                                  344.0 ± 0%    342.0 ± 0%   -0.58% (p=0.000 n=10)
Bind/jsxComplexSignatureHasApplicabilityError.tsx-20    280.0 ± 0%    278.0 ± 0%   -0.71% (p=0.000 n=10)
geomean                                                 565.9         520.5        -8.03%

Comment on lines +45 to +46
unreachableFlow *ast.FlowNode
reportedUnreachableFlow *ast.FlowNode
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was previously far too clever; this was actually a bad idea because we were keeping every Binder alive longer than it needed to be. Reusing the Binders caused a race for that reason, since we were taking an interior pointer.

@jakebailey jakebailey added this pull request to the merge queue Mar 3, 2025
Merged via the queue into main with commit 08f0dc9 Mar 3, 2025
17 checks passed
@jakebailey jakebailey deleted the jabaile/pool-binder branch March 3, 2025 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants