grammars-v4 icon indicating copy to clipboard operation
grammars-v4 copied to clipboard

[Swift] Need help with optimization

Open neon12345 opened this issue 1 year ago • 0 comments
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?

neon12345 avatar Jan 02 '24 23:01 neon12345