perf(semantic): reduce AstNodeId to u32 (#4264)

`AstNodeId` was a `usize`. This seems excessive.

Parser has a limit on size of a JS file of 4 GiB. While it is *possible* for a JS file of that size to create an AST with more than `1 << 32` (~4 billion) AST nodes, that would be insanely large.

So make `AstNodeId` `u32` instead.
This commit is contained in:
overlookmotel 2024-07-15 04:31:51 +00:00
parent 23743dbd59
commit 8fad7dbac3

View file

@ -2,7 +2,7 @@ use bitflags::bitflags;
use oxc_index::define_index_type;
define_index_type! {
pub struct AstNodeId = usize;
pub struct AstNodeId = u32;
}
impl AstNodeId {