diff options
author | 2021-04-22 14:24:28 -0700 | |
---|---|---|
committer | 2021-04-22 14:24:28 -0700 | |
commit | da509f3d5a732145afebbc7400a832785f1b439f (patch) | |
tree | 11384b2bc80b405bffa1515e3ac2dfe993a229d2 /src/js_ast.zig | |
parent | bee68ecc004864d1a1bbdfb0d49acf42ffe1f0d3 (diff) | |
download | bun-da509f3d5a732145afebbc7400a832785f1b439f.tar.gz bun-da509f3d5a732145afebbc7400a832785f1b439f.tar.zst bun-da509f3d5a732145afebbc7400a832785f1b439f.zip |
a
Diffstat (limited to 'src/js_ast.zig')
-rw-r--r-- | src/js_ast.zig | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/js_ast.zig b/src/js_ast.zig index 4bcc945a3..0a0bddbf3 100644 --- a/src/js_ast.zig +++ b/src/js_ast.zig @@ -26,10 +26,13 @@ const ImportRecord = @import("import_record.zig").ImportRecord; // But also it uses the least memory. // Since Data is a union, the size in bytes of Data is the max of all types // So with #1 or #2, if S.Function consumes 768 bits, that means Data must be >= 768 bits -// Which means "true" in codenow takes up over 768 bits, probably more than what v8 spends -// With this approach, Data is the size of a pointer. The value of the type decides the size. +// Which means "true" in code now takes up over 768 bits, probably more than what v8 spends +// Instead, this approach means Data is the size of a pointer. // It's not really clear which approach is best without benchmarking it. - +// The downside with this approach is potentially worse memory locality, since the data for the node is somewhere else. +// But it could also be better memory locality due to smaller in-memory size (more likely to hit the cache) +// only benchmarks will provide an answer! +// But we must have pointers somewhere in here because can't have types that contain themselves pub const BindingNodeIndex = Binding; pub const StmtNodeIndex = Stmt; pub const ExprNodeIndex = Expr; |