Closed msujew closed 9 months ago
As outlined in https://github.com/eclipse-langium/langium/discussions/1292, there seems to be a performance issue in our generator functions.
The generator toString() function seems to run in quadratic (O(n^2)) time. We should be able to get this down to linear time.
toString()
O(n^2)
Fixed with #1294.
As outlined in https://github.com/eclipse-langium/langium/discussions/1292, there seems to be a performance issue in our generator functions.
The generator
toString()
function seems to run in quadratic (O(n^2)
) time. We should be able to get this down to linear time.Reproducible Example
```ts import { CompositeGeneratorNode, NL, toString } from 'langium'; console.log('perfromance test'); const node = new CompositeGeneratorNode(); function prepare(node: CompositeGeneratorNode, l: number, r: number): void { if (r<=0) { for (let i=0;i