-
-
Notifications
You must be signed in to change notification settings - Fork 127
Open
Description
The compiler's proc_macro::Span uses an efficient encoding in 4 bytes. Currently our span when procmacro2_semver_exempt is enabled is a whopping 12 bytes because it essentially looks like:
enum Span { // tag + padding = 4 bytes
Compiler(proc_macro::Span), // 4 bytes
Fallback(struct Span { // 8 bytes
lo: u32,
hi: u32,
}),
}
And it goes up to 16 bytes when embedded next to 8-byte pointers due to additional padding.
This has a performance impact because syntax trees contain lots of spans.
We need to investigate interning the spans or some other trick to cut the size.
Metadata
Metadata
Assignees
Labels
No labels