grammars-v4
grammars-v4 copied to clipboard
[Swift] Need help with optimization
trafficstars
For the Swift v5 grammar there is a huge performance problem:
The fillUp function in the SwiftSupport class uses a lot of resources/time due to the way the LA and LT functions in the TokenStream classes are implemented. https://github.com/antlr/grammars-v4/blob/7749e057b2d20ffff9c633c58573918c21d16415/swift/swift5/Java/SwiftSupport.java#L373
I assume the fillUp function is used to fill internal buffers in the TokenStream and it probably must not be called every time.
Does anyone have an idea how to optimize this?