From fd7f605365b27bfdd3cd6763124e81bddd61dd28 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 4 Apr 2019 15:46:33 +1100 Subject: Increase `Span` from 4 bytes to 8 bytes. This increases the size of some important types, such as `ast::Expr` and `mir::Statement`. However, it drastically reduces how much the interner is used, and the fields are more natural sizes that don't require bit operations to extract. As a result, instruction counts drop across a range of workloads, by as much as 12% for incremental "check" builds of `script-servo`. Peak memory usage goes up a little for some cases, but down by more for some other cases -- as much as 18% for non-incremental builds of `packed-simd`. The commit also: - removes the `repr(packed)`, because it has negligible effect, but can cause undefined behaviour; - replaces explicit impls of common traits (`Copy`, `PartialEq`, etc.) with derived ones. --- src/libsyntax/ast.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index bcc8fdf8cd4..cf909e30e32 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -946,7 +946,7 @@ pub struct Expr { // `Expr` is used a lot. Make sure it doesn't unintentionally get bigger. #[cfg(target_arch = "x86_64")] -static_assert!(MEM_SIZE_OF_EXPR: std::mem::size_of::() == 88); +static_assert!(MEM_SIZE_OF_EXPR: std::mem::size_of::() == 96); impl Expr { /// Whether this expression would be valid somewhere that expects a value; for example, an `if` -- cgit 1.4.1-3-g733a5