-
Notifications
You must be signed in to change notification settings - Fork 12.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
Use lookup tables for common functions on node kinds. #59954
base: main
Are you sure you want to change the base?
Conversation
@typescript-bot perf test this |
@DanielRosenwasser Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
tsserverComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
startupComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
@typescript-bot perf test this |
@DanielRosenwasser Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
tsserverComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
startupComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
IsExpression = StrictlyMiscellaneousExpression | IsUnaryExpression, | ||
} | ||
|
||
const nodeKindFacts: NodeKindFacts[] = []; |
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.
I think you'd actually have better perf filling pre-filling this with numbers to get one of those special compact arrays
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.
I'm pretty sure that happens today with push
according to https://v8.dev/blog/elements-kinds and this test:
let x = [];
console.log("Unfilled:");
%DebugPrint(x);
for (let i = 0; i < 10; i++) {
x.push(i);
}
console.log("Filled:");
%DebugPrint(x);
Output
Unfilled:
DebugPrint: 0xcfb0004ab5d: [JSArray]
- map: 0x0cfb0018e6b9 <Map[16](PACKED_SMI_ELEMENTS)> [FastProperties]
- prototype: 0x0cfb0018e92d <JSArray[0]>
- elements: 0x0cfb000006cd <FixedArray[0]> [PACKED_SMI_ELEMENTS]
- length: 0
- properties: 0x0cfb000006cd <FixedArray[0]>
- All own properties (excluding elements): {
0xcfb00000d41: [String] in ReadOnlySpace: #length: 0x0cfb0028741d <AccessorInfo name= 0x0cfb00000d41 <String[6]: #length>, data= 0x0cfb00000061 <undefined>> (const accessor descriptor), location: descriptor
}
0xcfb0018e6b9: [Map] in OldSpace
- map: 0x0cfb00183c35 <MetaMap (0x0cfb00183c85 <NativeContext[285]>)>
- type: JS_ARRAY_TYPE
- instance size: 16
- inobject properties: 0
- unused property fields: 0
- elements kind: PACKED_SMI_ELEMENTS
- enum length: invalid
- back pointer: 0x0cfb00000061 <undefined>
- prototype_validity cell: 0x0cfb00000a31 <Cell value= 1>
- instance descriptors #1: 0x0cfb0018ef45 <DescriptorArray[1]>
- transitions #1: 0x0cfb0018ef61 <TransitionArray[4]>Transition array #1:
0x0cfb00000e05 <Symbol: (elements_transition_symbol)>: (transition to HOLEY_SMI_ELEMENTS) -> 0x0cfb0018ef79 <Map[16](HOLEY_SMI_ELEMENTS)>
- prototype: 0x0cfb0018e92d <JSArray[0]>
- constructor: 0x0cfb0018e625 <JSFunction Array (sfi = 0xcfb0028c6ad)>
- dependent code: 0x0cfb000006dd <Other heap object (WEAK_ARRAY_LIST_TYPE)>
- construction counter: 0
Filled:
DebugPrint: 0xcfb0004ab5d: [JSArray]
- map: 0x0cfb0018e6b9 <Map[16](PACKED_SMI_ELEMENTS)> [FastProperties]
- prototype: 0x0cfb0018e92d <JSArray[0]>
- elements: 0x0cfb0004ab6d <FixedArray[17]> [PACKED_SMI_ELEMENTS]
- length: 10
- properties: 0x0cfb000006cd <FixedArray[0]>
- All own properties (excluding elements): {
0xcfb00000d41: [String] in ReadOnlySpace: #length: 0x0cfb0028741d <AccessorInfo name= 0x0cfb00000d41 <String[6]: #length>, data= 0x0cfb00000061 <undefined>> (const accessor descriptor), location: descriptor
}
- elements: 0x0cfb0004ab6d <FixedArray[17]> {
0: 0
1: 1
2: 2
3: 3
4: 4
5: 5
6: 6
7: 7
8: 8
9: 9
10-16: 0x0cfb000006e9 <the_hole_value>
}
0xcfb0018e6b9: [Map] in OldSpace
- map: 0x0cfb00183c35 <MetaMap (0x0cfb00183c85 <NativeContext[285]>)>
- type: JS_ARRAY_TYPE
- instance size: 16
- inobject properties: 0
- unused property fields: 0
- elements kind: PACKED_SMI_ELEMENTS
- enum length: invalid
- back pointer: 0x0cfb00000061 <undefined>
- prototype_validity cell: 0x0cfb00000a31 <Cell value= 1>
- instance descriptors #1: 0x0cfb0018ef45 <DescriptorArray[1]>
- transitions #1: 0x0cfb0018ef61 <TransitionArray[4]>Transition array #1:
0x0cfb00000e05 <Symbol: (elements_transition_symbol)>: (transition to HOLEY_SMI_ELEMENTS) -> 0x0cfb0018ef79 <Map[16](HOLEY_SMI_ELEMENTS)>
- prototype: 0x0cfb0018e92d <JSArray[0]>
- constructor: 0x0cfb0018e625 <JSFunction Array (sfi = 0xcfb0028c6ad)>
- dependent code: 0x0cfb000006dd <Other heap object (WEAK_ARRAY_LIST_TYPE)>
- construction counter: 0
Compiler returned: 0
No description provided.