-
-
Notifications
You must be signed in to change notification settings - Fork 128
Closed
Description
I use syn to parse Rust files outside of Rust macros and I noticed really slow performance in fallback::Span.
The problem seems like that there is a SOURCE_MAP
thread local that only keeps growing. I never destroy the threads, it's a thread pool. Now I could try to create new threads every time I call into syn, but this seems silly.
Also, why is SourceMap::files
a Vec
? It seems like the spans in FileInfo
can never overlap, so why not just use a BTreeMap
sorted by span.start to look up the files? At least then it would be O(log n)
for look ups even if it keeps growing.
Metadata
Metadata
Assignees
Labels
No labels