I have generated a Stratego fragment for which JSGLR takes unreasonably long to parse. The parse time grows super-linerarily with the file size.

  • 47 LOC -> 0m2s
  • 73 LOC -> 1m24s
  • 78 LOC -> 2m6s

The 73 LOC snippet is:

module Java-long
imports libstratego-lib

rules
main = io-wrap(id)

put-syntax-sort(|t) = fail

rules
smart-FromMetaExpr(|arg1) =
  put-syntax-sort(
| <prim("SUGARJ_unsafe_build", "Sort")> ["Alt"|[ [<prim("SUGARJ_unsafe_build", "Sort")> ["Alt"|[ [<prim("SUGARJ_unsafe_build", "SortNoArgs")> ["JavaID"]|[<prim("SUGARJ_unsafe_build", "SortNoArgs")> ["JavaSingleChar"]]]
 ]]|[ <prim("SUGARJ_unsafe_build", "Sort")> ["Alt"|[ [<prim("SUGARJ_unsafe_build", "Sort")> ["Alt"|[ [<prim("SUGARJ_unsafe_build", "SortNoArgs")> ["JavaID"]|[<prim("SUGARJ_unsafe_build", "SortNoArgs")> ["JavaStringChars"]]]
 ]]|[ <prim("SUGARJ_unsafe_build", "Sort")> ["Alt"|[ [<prim("SUGARJ_unsafe_build", "Sort")> ["Alt"|[ [<prim("SUGARJ_unsafe_build", "SortNoArgs")> ["JavaID"]|[<prim("SUGARJ_unsafe_build", "SortNoArgs")> ["JavaSingleChar"]]]
 ]]|[ <prim("SUGARJ_unsafe_build", "Sort")> ["Alt"|[ [<prim("SUGARJ_unsafe_build", "Sort")> ["Alt"|[ [<prim("SUGARJ_unsafe_build", "SortNoArgs")> ["JavaID"]|[<prim("SUGARJ_unsafe_build", "SortNoArgs")> ["JavaStringChars"]]]
 ]]|[ <prim("SUGARJ_unsafe_build", "Sort")> ["Alt"|[ [<prim("SUGARJ_unsafe_build", "Sort")> ["Alt"|[ [<prim("SUGARJ_unsafe_build", "SortNoArgs")> ["JavaID"]|[ <prim("SUGARJ_unsafe_build", "Sort")> ["List"|[ [<prim("SUGARJ_unsafe_build", "SortNoArgs")> ["JavaImportDec"]]
 ]]
 ]]
 ]]|[ <prim("SUGARJ_unsafe_build", "Sort")> ["Alt"|[ [<prim("SUGARJ_unsafe_build", "Sort")> ["Alt"|[ [<prim("SUGARJ_unsafe_build", "SortNoArgs")> ["JavaID"]|[<prim("SUGARJ_unsafe_build", "SortNoArgs")> ["JavaImportDec"]]]
 ]]|[ <prim("SUGARJ_unsafe_build", "Sort")> ["Alt"|[ [<prim("SUGARJ_unsafe_build", "Sort")> ["Alt"|[ [<prim("SUGARJ_unsafe_build", "SortNoArgs")> ["JavaID"]|[ <prim("SUGARJ_unsafe_build", "Sort")> ["Option"|[ [<prim("SUGARJ_unsafe_build", "SortNoArgs")> ["JavaPackageDec"]]
 ]]
 ]]
 ]]|[ <prim("SUGARJ_unsafe_build", "Sort")> ["Alt"|[ [<prim("SUGARJ_unsafe_build", "Sort")> ["Alt"|[ [<prim("SUGARJ_unsafe_build", "SortNoArgs")> ["JavaID"]|[<prim("SUGARJ_unsafe_build", "SortNoArgs")> ["JavaPackageDec"]]]
 ]]|[ <prim("SUGARJ_unsafe_build", "Sort")> ["Alt"|[ [<prim("SUGARJ_unsafe_build", "Sort")> ["Alt"|[ [<prim("SUGARJ_unsafe_build", "SortNoArgs")> ["JavaID"]|[ <prim("SUGARJ_unsafe_build", "Sort")> ["List"|[ [<prim("SUGARJ_unsafe_build", "SortNoArgs")> ["JavaFormalParam"]]
 ]]
 ]]
 ]]|[ <prim("SUGARJ_unsafe_build", "Sort")> ["Alt"|[ [<prim("SUGARJ_unsafe_build", "Sort")> ["Alt"|[ [<prim("SUGARJ_unsafe_build", "SortNoArgs")> ["JavaID"]|[<prim("SUGARJ_unsafe_build", "SortNoArgs")> ["JavaFormalParam"]]]
 ]]|[ <prim("SUGARJ_unsafe_build", "Sort")> ["Alt"|[ [<prim("SUGARJ_unsafe_build", "Sort")> ["Alt"|[ [<prim("SUGARJ_unsafe_build", "SortNoArgs")> ["JavaID"]|[<prim("SUGARJ_unsafe_build", "SortNoArgs")> ["JavaRefType"]]]
 ]]|[ <prim("SUGARJ_unsafe_build", "Sort")> ["Alt"|[ [<prim("SUGARJ_unsafe_build", "Sort")> ["Alt"|[ [<prim("SUGARJ_unsafe_build", "SortNoArgs")> ["JavaID"]|[<prim("SUGARJ_unsafe_build", "SortNoArgs")> ["JavaRefType"]]]
 ]]|[ <prim("SUGARJ_unsafe_build", "Sort")> ["Alt"|[ [<prim("SUGARJ_unsafe_build", "Sort")> ["Alt"|[ [<prim("SUGARJ_unsafe_build", "SortNoArgs")> ["JavaID"]|[<prim("SUGARJ_unsafe_build", "SortNoArgs")> ["JavaArrayBaseType"]]]
 ]]|[ <prim("SUGARJ_unsafe_build", "Sort")> ["Alt"|[ [<prim("SUGARJ_unsafe_build", "Sort")> ["Alt"|[ [<prim("SUGARJ_unsafe_build", "SortNoArgs")> ["JavaID"]|[<prim("SUGARJ_unsafe_build", "SortNoArgs")> ["JavaArrayBaseType"]]]
 ]]|[ <prim("SUGARJ_unsafe_build", "Sort")> ["Alt"|[ [<prim("SUGARJ_unsafe_build", "Sort")> ["Alt"|[ [<prim("SUGARJ_unsafe_build", "SortNoArgs")> ["JavaID"]|[<prim("SUGARJ_unsafe_build", "SortNoArgs")> ["JavaType"]]]
 ]]|[ <prim("SUGARJ_unsafe_build", "Sort")> ["Alt"|[ [<prim("SUGARJ_unsafe_build", "Sort")> ["Alt"|[ [<prim("SUGARJ_unsafe_build", "SortNoArgs")> ["JavaID"]|[<prim("SUGARJ_unsafe_build", "SortNoArgs")> ["JavaType"]]]
 ]]|[ <prim("SUGARJ_unsafe_build", "Sort")> ["Alt"|[ [<prim("SUGARJ_unsafe_build", "Sort")> ["Alt"|[ [<prim("SUGARJ_unsafe_build", "SortNoArgs")> ["JavaID"]|[<prim("SUGARJ_unsafe_build", "SortNoArgs")> ["JavaBlock"]]]
 ]]|[ <prim("SUGARJ_unsafe_build", "Sort")> ["Alt"|[ 
 ]]
]]
 ]]
]|]
 ]]
]]
 ]]
]]
 ]]
]]
 ]]
]]
 ]]
]]
 ]]
]]
 ]]
]]
 ]]
]]
 ]]
]]
 ]]
]]
 ]]
]]
 ]]
]]
 ]]
]]
 ]]
]]
 ]]
]]
 ]]
)
; id
Submitted by Sebastian Erdweg on 9 May 2013 at 01:00

On 9 May 2013 at 01:02 Sebastian Erdweg commented:

I tested with the latest stable as well as nightly. Parse times are comparably slow.


On 13 July 2013 at 20:28 Gabriël Konat tagged parser

On 13 July 2013 at 20:30 Gabriël Konat tagged performance

Log in to post comments